【问题标题】:I get a parse error related to the master page我收到与母版页相关的解析错误
【发布时间】:2019-07-07 18:13:48
【问题描述】:

我做了一个母版页,我有这个错误: 解析器错误 说明:解析服务此请求所需的资源时出错。请查看以下特定的解析错误详细信息并适当地修改您的源文件。

解析器错误消息:此处不允许使用“Hogwarts_School.accmaster”,因为它没有扩展类“System.Web.UI.MasterPage”。

第 1 行:

【问题讨论】:

  • 正如它在错误消息中所说的那样。您的类必须继承自 MasterPage。

标签: c# asp.net visual-studio


【解决方案1】:

在您的 accmaster.master.cs 中应该如下所示:

public class accmaster: System.Web.UI.MasterPage
{
    // code goes here
}

“System.Web.UI.MasterPage”文本表示 accmaster 扩展的类。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-20
    • 1970-01-01
    • 1970-01-01
    • 2013-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-12
    相关资源
    最近更新 更多