Wednesday, March 31, 2010

What is base class of page in ASP.NET?

Single – File Pages: - In a single file page, the markup, server – side elements, and event-handling code are all in a single .aspx file. The base class of single – file page is Page class which is under System.Web.UI namespace.

Code – Behind Pages: - In the code – behind model, the page’s markup and server-side elements, including control declarations, are in an .aspx file, while our page code is in a separate code file. The code file contains a partial class – that is, a class declaration with the keyword partial indicating that it contains only some of the total code that makes up the full class for the page. In the partial class, we add the code that our application requires for the page. This typically consists of event handlers, but can include any methods or properties that we need. The code – behind file contains a partial class that inherits from a base page class. The base page class can be the Page class, or it can be another class that derives for Page.

No comments:

Post a Comment