ScriptManager.RegisterPostBackControl problem

Last post 07-06-2009 8:31 AM by atconway. 3 replies.

Sort Posts:

  • ScriptManager.RegisterPostBackControl problem

    07-03-2009, 7:21 AM
    • Member
      10 point Member
    • rbadis
    • Member since 04-23-2007, 7:44 AM
    • Posts 339

     Hi,

    I've created a web user control that have a FileUpload and a Button, and did put this control inside an UpdatePanel then register it like : 

    ScriptManager.RegisterPostBackControl(Document1)

    and it worked OK. But the problem is that if I put another instance of my control and register them like:

    ScriptManager.RegisterPostBackControl(Document1)

    ScriptManager.RegisterPostBackControl(Document2)

    The second instance (Document2) works fine but Not the first one (Document1) and for that I'm assuming that only the second Document did get registered.

    So, how can register more then one control?

     

    Thanks

     

     

     

    badis
  • Re: ScriptManager.RegisterPostBackControl problem

    07-03-2009, 9:34 AM
    • Contributor
      5,250 point Contributor
    • atconway
    • Member since 09-24-2007, 9:20 PM
    • Florida U.S.A
    • Posts 1,126

    This may not have to do with the fact that the second control did not get registered, but rather it may be an issue with using both of those controls and having an issue with multiple asynchronous postbacks which will not work without some intervention in JS.  Take a look at the following article: http://disturbedbuddha.wordpress.com/2007/12/12/handling-multiple-asynchronous-postbacks/

    Hope this helps!

    Thank you,   >[Blog]<

    "The best thing about a boolean is even if you are wrong, you are only off by a bit." :D
    -anonymous

  • Re: ScriptManager.RegisterPostBackControl problem

    07-03-2009, 7:54 PM
    • Member
      10 point Member
    • rbadis
    • Member since 04-23-2007, 7:44 AM
    • Posts 339

     if that's the case, why it didn't happen with other controls in my form such as button or other textboxes the I had set them to postback!!? why only happen with my custom control?

     

    Thanks 

     

     

    badis
  • Re: ScriptManager.RegisterPostBackControl problem

    07-06-2009, 8:31 AM
    Answer
    • Contributor
      5,250 point Contributor
    • atconway
    • Member since 09-24-2007, 9:20 PM
    • Florida U.S.A
    • Posts 1,126

    It doesn;t have anything to do with regular ASP.NET controls that have Postback="true" set.  The asyncronous issue is in regrds to using the 'ScriptManager.RegisterPostBackControl' method from AJAX.  You do not register your ASP.NET controls with this method.

    I was wondering if it may be an issue with your custom controls are trying to post back at the exact same time which one will cancel out the other.  The article explains which postback takes presedence.

     

    Thank you,   >[Blog]<

    "The best thing about a boolean is even if you are wrong, you are only off by a bit." :D
    -anonymous

Page 1 of 1 (4 items)