基类代码:
using System;
using System.Web;
using System.Configuration;
using System.Web.SessionState;
using GcPopedom.PopedomClass;
using ComFunction;namespace BasePageClass
{
/// <summary>
/// Class 的摘要说明。
/// </summary>
public class BasePage:System.Web.UI.Page
{
public FunctionClass FunClass =new FunctionClass();
public PopedomService PdmClass =new PopedomService(); #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.Load  += new System.EventHandler(this.Page_Load);
            this.Error += new System.EventHandler(this.Page_Error);
}
#endregion private void Page_Load(object sender, System.EventArgs e)
{
PdmClass.PageLoadPopedom(Session["UserID"].ToString());
} private void Page_Error(object sender,System.EventArgs e)
{
string errMessage = Server.GetLastError().Message;
errMessage+="&pPath="+Request.Path;
Server.ClearError();
Response.Redirect("/"+ConfigurationSettings.AppSettings["ProgramName"]+"/FrameWork/CommForm/AccessError.aspx?pError="+errMessage);
}
}
}
我想让我增加新页面时,能知道继承这个类

解决方案 »

  1.   

    例如
    D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\Web\CSharp\2052\WebForm.zip\
    里面有一个文件:  CodeBeside.cs打开编辑之,vs每次新增页面都是调用此模版
      

  2.   

    using System;
    using System.Web;
    using System.Configuration;
    using System.Web.SessionState;
    using GcPopedom.PopedomClass;
    using ComFunction;using 继承的那个类!
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;using Tool;//工具
    using Manager;//管理类
    using Entity;//实体类