不使用aspx.cs文件,怎样使aspx的页面从page的一个派生类继承,而不从page继承?

解决方案 »

  1.   

    #region 页面基类
    //write by zx 2003/12/20
    //所有页面从此页面继承。
    #endregionusing System;
    using System.Web;
    using System.Web.UI;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.ComponentModel;
    using System.Data;using IST.Common;namespace IST
    {
    /// <summary>
    /// PageBase 的摘要说明。
    /// </summary>
    public class PageBase : Page   //这句就是
    {
    private const string COMMA = "?";
    private const string AMP = "&";
    private static readonly Regex RX = new Regex(@"^&page=\d+", RegexOptions.Compiled); protected const string KEY_SESSION_QRYSQLSTRING = "QrySQLString"; public PageBase()
    {
    } public string ApplicationTitle
    {
    get
    {
    return AppConfiguration.ApplicationTitle;
    }
    }
      

  2.   

    使用时应用  IST 命名空间  public class webform1: System.Web.UI.Page
    改为
    public class webform1: PageBase  //即可
      

  3.   

    我不想使用cs文件,我的页面只有aspx文件怎么做呢。
      

  4.   

    cs文件的内容可以写在ASPX文件里嘛
      

  5.   

    呵呵,其实无论你怎么写,你得到的类都不是一个实现类,而是一个抽象类
    不信,你可以把public class PageBase : Page   改成public abstract class PageBase : Page   试试:)
      

  6.   

    <%@ Page Inherits="xxx" %>