Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ';使用';必须以匹配的';结束使用';_C#_.net_Asp.net Mvc 2 - Fatal编程技术网

C# ';使用';必须以匹配的';结束使用';

C# ';使用';必须以匹配的';结束使用';,c#,.net,asp.net-mvc-2,C#,.net,Asp.net Mvc 2,我试图使用Html.RenderPartial,但出现错误: “Using”必须以匹配的“end Using”结尾 视图: 创造 创造 局部视图: <% using (Html.BeginForm()) {%> <%: Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="

我试图使用Html.RenderPartial,但出现错误:

“Using”必须以匹配的“end Using”结尾

视图:


创造
创造
局部视图:

<% using (Html.BeginForm()) {%>
    <%: Html.ValidationSummary(true) %>

    <fieldset>
        <legend>Fields</legend>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.EmployeeID) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.EmployeeID) %>
            <%: Html.ValidationMessageFor(model => model.EmployeeID) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.NationalIDNumber) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.NationalIDNumber) %>
            <%: Html.ValidationMessageFor(model => model.NationalIDNumber) %>
        </div>


        <div class="editor-label">
            <%: Html.LabelFor(model => model.ModifiedDate) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ModifiedDate, String.Format("{0:g}", Model.ModifiedDate)) %>
            <%: Html.ValidationMessageFor(model => model.ModifiedDate) %>
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
<% } %>

领域
model.EmployeeID)%>
model.EmployeeID)%>
model.EmployeeID)%>
型号(国家编号)%>
型号(国家编号)%>
型号(国家编号)%>
model.ModifiedDate)%%>
model.ModifiedDate,String.Format(“{0:g}”,model.ModifiedDate))%>
model.ModifiedDate)%%>


错误消息表明代码被解析为VB,而不是C。您是否无意中为部分视图指定了错误的语言?

我知道了,我忘了在视图顶部放置这行代码:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<mvc2Test.Models.Employee>" %>

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<mvc2Test.Models.Employee>" %>