我有以下 Razor 标记块:
@section StoreSearch
{
@Html.Partial("SearchPartial", Model)
}
<section id="gallery-index">
...
</section>
<nav class="pager">
<a href="#" rel="prev" class="pager-nav" title="Previous Page">Prev</a> Page @(Model.PageIndex + 1) of @Model.PageCount <a href="#" rel ="next" class="pager-nav" title="Next Page">Next</a>
</nav>
我想用一个表格包围整个街区,如
@using (Html.BeginForm("Index", "Gallery", FormMethod.Post, new { id = "search-form" }))
{
@section StoreSearch
{
@Html.Partial("SearchPartial", Model)
}
<section id="gallery-index">
...
}
然而,当我这样做时,解析器似乎@section StoreSearch
对这部分犹豫不决,并抱怨“无法解析符号 StoreSearch”。
是我试图不允许的,还是我只是错过了某种转义方法?