Я пытаюсь добавить представление aspx в MVC вместо Razor View.
Я получаю сообщение об ошибке в строке <%@ Html.DisplayNameFor(model => model.Name) %>
Сообщение об ошибке синтаксического анализатора: блок сервера сформирован неправильно,<--- в браузере </p>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="WebApplication1.Views.EmployeesPart25MVC.List" %> <%@ Import Namespace="WebApplication1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">
<title></title> </head> <body>
<form id="form1" runat="server">
<div>
<h2>
Gomathi
</h2>
<table class="table">
<tr>
<th>
<%@ Html.DisplayNameFor(model => model.Name) %>
</th>
<th>
<%@ Html.DisplayNameFor(model => model.Gender) %>
</th>
<th>
<%@ Html.DisplayNameFor(model => model.City) %>
</th>
<th>
<%@ Html.DisplayNameFor(model => model.DepartmentsPart25MVC.Name) %>
</th>
<th></th>
</tr>
<%@foreach (var item in Model)
{ %>
<tr>
<td>
<%@ Html.DisplayFor(modelItem => item.Name) %>
</td>
<td>
<%@ Html.DisplayFor(modelItem => item.Gender) %>
</td>
<td>
<%@ Html.DisplayFor(modelItem => item.City) %>
</td>
<td>
<%@ Html.DisplayFor(modelItem => item.DepartmentsPart25MVC.Name) %>
</td>
<td>
<%@ Html.ActionLink("Edit", "Edit", new { id=item.EmployeeID }) |
Html.ActionLink("Details", "Details", new { id=item.EmployeeID }) |
Html.ActionLink("Delete", "Delete", new { id=item.EmployeeID }) %>
</td>
</tr>
<%@ } %>
</table>
</div>
</form> </body>
</html>