Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamically Add User Control - Loads Twice

Reply
Thread Tools

Dynamically Add User Control - Loads Twice

 
 
yohaas
Guest
Posts: n/a
 
      10-12-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page with User control loads twice. RAMESH BABU VEERAMANI (RAMBAB) ASP .Net Web Controls 1 07-28-2006 10:49 PM
Dynamically Adding User Control with Child User Control Travis Pruitt ASP .Net Building Controls 0 01-13-2005 08:49 PM
Re: ASP.NET page loads twice when loaded, why? Scott Allen ASP .Net 0 08-04-2004 02:09 PM
ASP .NET page loads twice Sue Rawlings ASP .Net 3 02-10-2004 10:19 PM
Help, page loads twice Nathon Dalton ASP .Net 0 06-26-2003 04:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57