see this page...
http://west-wind.com/weblog/posts/3016.aspx
its really very gud...
Regards,
Satheesh
-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/
public class WebForm1 : MyBaseClass
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
...
}
where MyBaseClass is,
public class MyBaseClass : System.Web.UI.Page
{
protected override void OnLoad(EventArgs e)
{
// ... add custom logic here ...
// Be sure to call the base class's OnLoad method!
base.OnLoad(e);
}
}
Why We need a Base Class???
A base class is advantageous if there is some common functionality
needed to be required on every ASP.NET page in your Web application.
That is, if you find yourself repeatedly copying and pasting the same
snippet of code into most, if not all, ASP.NET pages in your
application, you should seriously consider using a base class. With a
base class you can define this common behavior in one spot. The ASP.NET
page's that inherit from this base class, then, will automatically
perform the needed functionality. If there needs to be a change to this
common logic, you'll only need to change it in one place - the base
class - as opposed to having to change the code in all the ASP.NET
pages.
What will happen in the Server?
Normally the page parser first parses the aspx page ie html& script
page and create a class out of it and makes this class to inherit the
code behind class (aspx.cs) and in turn inherits our base class which
inherits the Page Class.
Like..
Class htmlClass:WebForm1.aspx.cs (out of the html and scripts)
{
}
Regards,
Satheesh