当前位置: 代码迷 >> .NET新技术 >> asp.net mvc2.0 在view新建一个页面报错解决办法
  详细解决方案

asp.net mvc2.0 在view新建一个页面报错解决办法

热度:256   发布时间:2016-04-25 01:28:43.0
asp.net mvc2.0 在view新建一个页面报错
问题:新建的页面总是运行时编译不通过。
使用工具VS2010
请高手帮我看看这是什么原因。
操作如图:

代码如下:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Modes.User>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ViewPage3</title>
</head>
<body>
    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.ID) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.ID) %>
                <%: Html.ValidationMessageFor(model => model.ID) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Username) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Username) %>
                <%: Html.ValidationMessageFor(model => model.Username) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Realname) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Realname) %>
                <%: Html.ValidationMessageFor(model => model.Realname) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Password) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Password) %>
                <%: Html.ValidationMessageFor(model => model.Password) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Phone) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Phone) %>
                <%: Html.ValidationMessageFor(model => model.Phone) %>
            </div>
  相关解决方案