请问:不使用aspx.cs文件,怎样使aspx的页面从page的一个派生类继承,而不从page继承。 不使用aspx.cs文件,怎样使aspx的页面从page的一个派生类继承,而不从page继承? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 #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; } } 使用时应用 IST 命名空间 public class webform1: System.Web.UI.Page改为public class webform1: PageBase //即可 我不想使用cs文件,我的页面只有aspx文件怎么做呢。 cs文件的内容可以写在ASPX文件里嘛 呵呵,其实无论你怎么写,你得到的类都不是一个实现类,而是一个抽象类不信,你可以把public class PageBase : Page 改成public abstract class PageBase : Page 试试:) <%@ Page Inherits="xxx" %> 这样写会点击它没有效果吗? 快速.NET网站生成系统软件都有什么好用? IHttpModule 重定向css中的图片 关于 windows 认证的 AuthenticationType 的问题 可不可以帮我调试一下这个程序,快疯啦 在asp.net中怎么输出图片? Context.Cache vml的问题 关于日期转换的问题? 关于类的命名空间的问题,请大家帮忙看一下. 求助:.net+access数据库,执行程序时出现错误! 请问一个很弱的问题 table指定行读取
//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;
}
}
改为
public class webform1: PageBase //即可
不信,你可以把public class PageBase : Page 改成public abstract class PageBase : Page 试试:)