Asp.net <;%@页面语言=";“C”;AutoEventWireup=";“真的”;代码文件="&引用;继承=""E;%&燃气轮机;

Asp.net <;%@页面语言=";“C”;AutoEventWireup=";“真的”;代码文件="&引用;继承=""E;%&燃气轮机;,asp.net,Asp.net,我试图运行我的应用程序,它给我错误: 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). 请告诉我此标记中此inherits参数的用法?您似乎缺少CodeFileBaseClass属性,该属性应指向您的基类 <%@ Page la

我试图运行我的应用程序,它给我错误:

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).

请告诉我此标记中此inherits参数的用法?

您似乎缺少CodeFileBaseClass属性,该属性应指向您的基类

<%@ Page language="c#" Inherits="University.AspNet.Index" CodeFile="Index.aspx.cs" CodeFileBaseClass="XXXXXX" %>

  • CodeFileBaseClass 为页及其关联的代码隐藏类指定基类的路径。此属性是可选的,但当使用它时,代码文件属性也必须存在
你是说你故意让它空着?你能试着把它完全省略吗?它用于使为页面生成的类从您提供的另一个基类继承,该基类本身必须从页面继承。(奇怪的是,这似乎在以后的.NET文档中消失了?)