Hi, Jon and everybody:
I work on a module which using ClientAPI and call RegisterPostBackEventHandler on Page_Init method like this:
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
ClientAPI.RegisterPostBackEventHandler(Page, "ClientSave", AddressOf ClientSaveDataCallBack, False)
End Sub
It works perfect on DNN 4.5.3 and does not work on 4.8.0. so in 4.8.0, I'm reading Jon's document and do the follow steps to enable RegisterPostBackEventHandler
1. Add <input id="__dnnVariable" type="hidden" name="__dnnVariable" runat="server"> on .ascx files, doesn't work
2.use the Hack method which Joe suggest on the PDF document which modify onParentOnLoad (and using RegisterPostBackEventHandler on OnParentOnLoad)
3.using ClientAPI.RegisterClientVariable(Page, "__dnnVariable", "", True) method on Page_Load to register __dnnVariable
and as the same, it doesn't work and it says:
Error: Edit RedstartForm is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases. ---> System.Web.HttpException: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases. at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.UI.Utilities.ClientAPI.RegisterPostBackEventHandler(Control objParent, String strEventName, PostBackEvent objDelegate, Boolean blnMultipleHandlers) at Confidence.Modules.RedstartForm.EditRedstartForm.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---
but it work perfect on DNN4.5.3. so what should I do? back to version 4.5.3?
thanks everybody