-
Page Load Order
I'm using a base class to create every page I have in my project. To build the actual page I use this code.
protected override void OnInit(System.EventArgs e)
{
this.Controls.AddAt(0, LoadControl("header.ascx"));
base.OnInit(e);
Control c1 = LoadControl("footer.ascx");
this.Controls.Add(c1);
}
The problem is, is that if I step through the code, it goes to the actual page's OnInit, then it comes to the base page and runs this override. So the contents on the page show on the top, then the header, and then the footer is added last. Why doesn't this override the OnInit on the page and run in this order? It used to, but I changed something and now I can't figure out what.
-
Attention to detail. I figured it out. I left some tags out of the HTML that was putting all out of whack.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks