PageBaseType属性的功用

来源:互联网 发布:淘宝视频像素多大 编辑:程序博客网 时间:2024/05/17 07:43

在web.config中经常能看到如下类似语句:<pages theme="Default"   pageBaseType="VS.Facade.PageBase,WebFacade"></pages>
微软官方解释pageBaseType是:指定.aspx页默认继承的代码隐藏类和程序集
网上有段关于其用法的英文解释:
        VS.NET uses code-behind (unless you avoid it, which I don't recommend), and therefore each ASPX page is specified to inherit from code-behind. The code-behind page specifies System.Web.UI.Page, so you must change it. The web.config setting is really only useful for non-code-behind pages. Its a great way to get ASMX pages to automatically inherit your base!
翻译下来大致意思是:
        VS.NET使用后台代码(除非你不用它,但我不建议这么处理), 因此每个aspx页面都继承后台代码文件. 后台代码页面类继承System.Web.UI.Page.因此你必须手工修改它. web.config设置只对那些无后台代码的页面有效,它极大地方便于应用ASMX页面类来自动继承你在web.config中设置的基类.