c# - Cannot unregister UpdatePanel with ID 'UpdatePanel1' since it was not registered with the ScriptManager -


here code:

protected override void oninit(eventargs e) {         scriptmanager sm = scriptmanager.getcurrent(this.page);         methodinfo m = (         methods in typeof(scriptmanager).getmethods(             bindingflags.nonpublic | bindingflags.instance             )         methods.name.equals("system.web.ui.iscriptmanagerinternal.registerupdatepanel")         select methods).first<methodinfo>();          m.invoke(sm, new object[] { updatepanel});         base.oninit(e); } 

aspx file:

<asp:updatepanel id="updatepanel1" runat="server"  onunload="updatepanel_unload"></asp:updatepanel> 

now shows error:

'asp.v4_inbox_new_aspx' not contain definition 'updatepanel_unload' , no extension method 'updatepanel_unload' accepting first argument of type 'asp.v4_inbox_new_aspx' found (are missing using directive or assembly reference?)

the name 'updatepanel' not exist in current context

'asp.v4_inbox_new_aspx' not contain definition 'updatepanel_unload' , no extension method 'updatepanel_unload' accepting first argument of type 'asp.v4_inbox_new_aspx' found (are missing using directive or assembly reference?)

this result of markup:

<asp:updatepanel id="updatepanel1" runat="server" onunload="updatepanel_unload"></asp:updatepanel> 

particularly, onunload="updatepanel_unload" wrong since updatepanel_unload not exist in code.

the name 'updatepanel' not exist in current context e:\selva\19-09-2015\alertid4\ui\v4\inbox_new.aspx.cs

this result of code:

m.invoke(sm, new object[] { updatepanel}); 

updatepanel not defined anywhere.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -