Page loads first and then the Master Page’s load event fires. After this, ASP.NET will then loop through all controls and fire their load event. This is how it’s done all the time.
If your code has some type of dependency, you will have to figure out how to handle it. Since I’m not sure what your dependency is, I really can’t help you out.
The Page_Load of the page executes first. You should be aware of this. The page life cycle is one of the most misunderstood issues in ASP.NET. That in addition to viewstate.
The Load event is raised for the page first and then recursively for all child controls. At this time, controls in the page tree are created and their state fully reflects both the previous state and any data posted from the client. The page is ready to execute any initialization code that has to do with the logic and behavior of the page. At this time, access to control properties and view state is absolutely safe.
Comments
Leave a comment Trackback