I have functionality I reuse in every web form. So I want this reuse in a base class and have the web form inherit the base class. Does my example use correct Object oriented practice ?? Here is an example:
using System;
using System.Web;
namespace Template1
{
public abstract class AllPageBaseClass : System.Web.UI.Page
{
public AllPageBaseClass()
{
this.Load += new EventHandler(this.Page_Load);
}
protected void Page_Load(object sender, EventArgs e)
{
if (Session["stuff"] == null)
Response.Write("Session Is Empty");
// More error checking common to all pages here
}
}
}
using System.Lots_Of_Stuff;
// Do I need System; and System.Web; here ??
namespace Template1
{
public partial class Home : AllPageBaseClass
{
protected new void Page_Load(object sender, EventArgs e)
{
// All unique Page_load stuff here
}
....
}
}