'使用'必须以匹配的"结束使用"结束

use*_*007 2 .net c# asp.net-mvc-2

我想使用Html.RenderPartial但收到错误:

'使用'必须以匹配的"结束使用"结束.

视图:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<mvc2Test.Models.Employee>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Create</h2>
    <% Html.RenderPartial("ViewUserControl1"); %>
</asp:Content>
Run Code Online (Sandbox Code Playgroud)

局部视图:

<% 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>
<% } %>
Run Code Online (Sandbox Code Playgroud)

Kon*_*lph 6

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