Parser Error: '_Default' is not allowed here because it does not extend class 'System.Web.UI.Page' & MasterType declaration

后端 未结 10 1311
说谎
说谎 2020-12-09 07:22

I recently converted a website project to a web application project in Visual Studio 2008. I finally got it to compile, and the first page (the login screen) displayed as n

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 08:11

    I had this issue, as I had copied a (fairly generic) webpage from one of my ASP.Net applications into a new application.

    I changed the relevant namespace commands, to reflect the new location of the file... but... I had forgotten to change the Inherits parameter in the aspx page itself.

    <%@ Page MasterPageFile="" StylesheetTheme="" Language="C#"
        AutoEventWireup="true" CodeBehind="MikesReports.aspx.cs" 
        Inherits="MikesCompany.MikesProject.MikesReports" %>
    

    Once I had changed the Inherits parameter, the error went away.

提交回复
热议问题