概述
asp.net 2.0 中,今天遇到了一个错误:
Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl)
原因是我的 CodeBehind 类继承了自定义的页面基类。按理以往也不该出错的,查了下 google:
http://forums.asp.net/t/941553.aspx
解决办法是:在 aspx 的 Page 指示节中加一个 CodeFileBaseClass 属性指名自定义的页面基类。
例如:
<%
@ Page Language
=
"
C#
"
AutoEventWireup
=
"
true
"
Inherits = " ZbUrbanPlanning.Web.admin.AddressBook.OrgManage "
CodeFile = " OrgManage.aspx.cs "
CodeFileBaseClass ="ZbUrbanPlanning.Web.PageBase" %>
Inherits = " ZbUrbanPlanning.Web.admin.AddressBook.OrgManage "
CodeFile = " OrgManage.aspx.cs "
CodeFileBaseClass ="ZbUrbanPlanning.Web.PageBase" %>
最后
以上就是单薄滑板为你收集整理的CodeFileBaseClass 属性的全部内容,希望文章能够帮你解决CodeFileBaseClass 属性所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复