【发布时间】:2008-12-19 13:46:11
【问题描述】:
我有一个新的 ASP.NET MVC 项目(我的第一个项目),我在 1 个控制器、视图和模型上运行良好。添加新控制器和视图后,当我尝试运行项目时,我的第一个视图开始抛出此错误消息:
描述:解析服务此请求所需的资源时出错。请查看以下特定的解析错误详细信息并适当地修改您的源文件。
Parser Error Message: 'PeopleManagement.Web.Views.Search.Search' is not allowed here because it does not extend class 'System.Web.UI.Page'.
Source Error:
Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Master.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="PeopleManagement.Web.Views.Search.Search" %>
Line 2: <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
Line 3: </asp:Content>
这是我为那个 aspx 页面编写的代码背后的全部内容:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace PeopleManagement.Web.Views.Search
{
public partial class Search : ViewPage
{
}
}
我不确定我的应用发生了什么变化导致了这种情况。看起来 VS 可能会将其作为 Web 表单应用程序而不是 MVC 应用程序来阅读?关于我应该从哪里开始排除故障的任何想法?
【问题讨论】:
标签: asp.net asp.net-mvc