这些%%
(两个百分比字符)在ASP.NET Razor MVC渲染器中的含义是什么?
@{
ViewBag.Title = %%Index%%;
}
当我使用添加>视图菜单创建新视图时。 使用这些配置:
我得到了以下代码:
@model IEnumerable<CadeMeuMedico.Models.Medico>
@{
ViewBag.Title = %%Index%%;
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.IDMedico)
</th>
<th>
@Html.DisplayNameFor(model => model.CRM)
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Email)
</th>
<th>
</th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.IDMedico)
</td>
<td>
@Html.DisplayFor(modelItem => item.CRM)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Email)
</td>
<td>
@Html.ActionLink("Edit", "Edit",
new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Details", "Details",
new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Delete", "Delete",
new { /* id=item.PrimaryKey */ })
</td>
</tr>
}
</table>