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" %>