Dynamically Add User Control - Loads Twice

Discussion in 'ASP .Net' started by yohaas, Oct 12, 2006.

  1. yohaas

    yohaas Guest

    I am dynamically adding user control to a page using
    Controls.Add(control). It seems that the Page_Load as well as the other
    page rendering events (Init, PreRender etc...) get fired twice. I
    assume that they are firing once by the Control.Add and once by the
    actual rendering of the page.

    The interesitng thing is that when it is a postback, the first time it
    fires IsPostBack is true but the second time, it's false.

    Any ideas what I can do to prevent this double firing?

    Thanks,
    yohaas
    yohaas, Oct 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathon Dalton

    Help, page loads twice

    Nathon Dalton, Jun 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    540
    Nathon Dalton
    Jun 26, 2003
  2. Sue Rawlings

    ASP .NET page loads twice

    Sue Rawlings, Feb 10, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,630
    Rimu Atkinson
    Feb 10, 2004
  3. Scott Allen
    Replies:
    0
    Views:
    1,812
    Scott Allen
    Aug 4, 2004
  4. Travis Pruitt

    Dynamically Adding User Control with Child User Control

    Travis Pruitt, Jan 13, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    173
    Travis Pruitt
    Jan 13, 2005
  5. RAMESH BABU VEERAMANI (RAMBAB)

    Page with User control loads twice.

    RAMESH BABU VEERAMANI (RAMBAB), Jul 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    162
Loading...

Share This Page