HighTechTalks DotNet Forums  

Re: Two User Controls: One gets called before the other

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Re: Two User Controls: One gets called before the other in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Gaurav Vaish \(www.Edujini-Labs.com\)
 
Posts: n/a

Default Re: Two User Controls: One gets called before the other - 01-10-2007 , 06:00 AM






What do you mean by "getting called"?

The order of loading (and rendering) is:

ParentControl.OnLoad followed by AllChildren.OnLoad which implies that first
Load even of Parent control is trigerred followed by that of the child
controls.

Similarly, the default implementation in RenderControl method is to render
all child controls.

There's no escape.
IIRC, there's some private / internal method LoadRecursive (you can get it
by simply overriding OnLoad method and throwing an exception and then
seeting the stacktrace). You would get a stacktrace similar to below:

Quote:
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +1061


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujinionline.com
-----------------------------------------


"A Programmer" <AProgrammer (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am working on another developers stuff and he has Two user controls: a
search UC and a grid UC the seach UC is embedding in the grid UC
consequently
the grid UC is getting called first and messing with my code. I need the
search UC to get called first. I am leaning toward just taking the search
UC
out of the grid UC. Any other ideas?



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.