Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIRegisterPostBackEventHandler works on DNN4.5.3 BUT NOT Work on 4.8.0RegisterPostBackEventHandler works on DNN4.5.3 BUT NOT Work on 4.8.0
Previous
 
Next
New Post
4/21/2008 8:34 PM
 

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

 
New Post
4/23/2008 9:32 PM
 

Can Joe or anybody help? I will have to lower my DNN version to 4.5.3 if cannot handle this...

 
New Post
4/24/2008 2:24 PM
 

I don't really know why you would be getting this error.  The only time the ClientAPI attempts to add a control to the collection is when the hidden control it needs to pass state back and forth doesn't already exist on the page.  Could you open up your site's default.aspx file and verify that the following line exists?

<input id="__dnnVariable" runat="server" name="__dnnVariable" type="hidden" />

 


 
New Post
12/10/2008 9:03 AM
 

Hi,

 

i'm having excactly the same problem; When getting to the ClientAPI.RegisterPostBackEventHandler the same errormessage (see below) appears - What's wrong?

 

regards, Tender

 

***

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

            If Not Page.IsPostBack Then

                If DotNetNuke.Framework.AJAX.IsInstalled Then

                    DotNetNuke.Framework.AJAX.RegisterScriptManager()

                End If

                If ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.DHTML) Then

                    ClientAPI.RegisterClientReference(Me.Page, ClientAPI.ClientNamespaceReferences.dnn)

                    ClientAPI.RegisterPostBackEventHandler(Me.Page, "CustomPostbackClient", AddressOf CustomPostbackServer, False)

                End If

            End If

        End Sub

***

The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

Source Error:

Line 28:                     ClientAPI.RegisterClientReference(Me.Page, ClientAPI.ClientNamespaceReferences.dnn)
Line 29: 
Line 30:                     ClientAPI.RegisterPostBackEventHandler(Me.Page, "CustomPostbackClient", AddressOf CustomPostbackServer, False) 
Line 31: 
Line 32:                 End If

Source File: ###    Line: 30

Stack Trace:

[HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.]
   System.Web.UI.ControlCollection.Add(Control child) +11010362
   DotNetNuke.UI.Utilities.ClientAPI.RegisterPostBackEventHandler(Control objParent, String strEventName, PostBackEvent objDelegate, Boolean blnMultipleHandlers) +256
   Modules.Grids.View.Page_Load(Object sender, EventArgs e) in ###:30
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

[PageLoadException: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.]
   DotNetNuke.Services.Exceptions.Exceptions.ProcessPageLoadException(Exception exc, String URL) +468
   System.Web.UI.TemplateControl.OnError(EventArgs e) +11026190
   System.Web.UI.Page.HandleError(Exception e) +109
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11031963
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11031514
   System.Web.UI.Page.ProcessRequest() +91
   System.Web.UI.Page.ProcessRequest(HttpContext context) +240
   ASP.default_aspx.ProcessRequest(HttpContext context) +52
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

 

 
New Post
1/14/2009 7:12 AM
 

Same problem with 5.0.0 !!!

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIRegisterPostBackEventHandler works on DNN4.5.3 BUT NOT Work on 4.8.0RegisterPostBackEventHandler works on DNN4.5.3 BUT NOT Work on 4.8.0


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out