Thread: Page_Prerender
View Single Post
  #6 (permalink)  
Old May 17th, 2011, 10:09 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

The Page class *is* the BaseClass. When you create a page, you let it inherit BasePage. So, the request for a page is handled by your BasePage. Its base class (eg. System.Web.UI.Page) then raises the event which is handled by the method you assign in the constructor of the BasePage class.

So, actually, Page and BasePage are more or less merged into a single class. The BasePage can do whatever Page can (but not vise versa) including handling the PreRender event.

Does this clarify things?

Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
markhh (May 20th, 2011)