在新的MVC项目母版页错误 [英] Master Page Error on New MVC Project

查看:170
本文介绍了在新的MVC项目母版页错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经刚刚创建一个新的MVC项目,并已在所有不需要做任何改变,但是当我尝试和查看设计模式ChangePasswordSuccess的看法,我得到的错误:

 的页面有需要母版页引用的控制,但没有提供。

该页面有除了内容的控制和文字文本没有控制,而且它有一个母版页引用。任何人都知道这是怎么回事?

 <%@ LANGUAGE =C#的MasterPageFile =〜/查看/共享/的Site.MasterAutoEventWireup =真codeBehind =ChangePasswordSuccess.aspx.cs 继承=BasicMvcApp.Views.Account.ChangePasswordSuccess%GT;< ASP:内容ID =changePasswordSuccessContentContentPlaceHolderID =日程地址搜索Maincontent=服务器>
    < H2>修改密码和LT; / H>
    &所述p为H.;
        您的密码已被更改成功。
    &所述; / P>
< / ASP:内容>


解决方案

刚问比注意到。默认ChangePasswordSuccess视图的Page指令丢失字

I've just create a new MVC project, and have made no changes at all, but when I try and view the ChangePasswordSuccess view in design mode, I get the error:

The page has controls that require a Master Page reference, but none is supplied.

The page has no controls except for a content control and literal text, and it does have a master page reference. Anyone know what's up?

<%@Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="ChangePasswordSuccess.aspx.cs" Inherits="BasicMvcApp.Views.Account.ChangePasswordSuccess" %>

<asp:Content ID="changePasswordSuccessContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Change Password</h2>
    <p>
        Your password has been changed successfully.
    </p>
</asp:Content>

解决方案

No sooner asked than noticed. The default ChangePasswordSuccess view's Page directive is missing the word Page.

这篇关于在新的MVC项目母版页错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆