Here is my code:
protected override void OnInit(EventArgs e)
{
ScriptManager sm = ScriptManager.GetCurrent(this.Page);
MethodInfo m = (
from methods in typeof(ScriptManager).GetMethods(
BindingFlags.NonPublic | BindingFlags.Instance
)
where 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 it shows the error:
'ASP.v4_inbox_new_aspx' does not contain a definition for 'UpdatePanel_Unload' and no extension method 'UpdatePanel_Unload' accepting a first argument of type 'ASP.v4_inbox_new_aspx' could be found (are you missing a using directive or an assembly reference?)
The name 'updatePanel' does not exist in the current context
UpdatePanel_Unloadfunction is not present in the code behind file. - Waqar Ahmed