@using (Html.BeginRouteForm("ProductSearch", FormMethod.Get))
{
<div class="page-title">
<h1>Search</h1>
</div>
<div class="clear">
</div>
<div class="search-inut">
//here there is code for product box of each product satisfying search condition
}
所有产品都以querystring的形式传递,以任何方式避免它? e.g
http:\ localhost:54632 \ mysite \ q =糖和糖5kg = 1&amp;无糖= 1 ..............
搜索结果中的所有产品都添加到查询字符串
中感谢名单
答案 0 :(得分:1)
更改
//here there is code for product box of each product satisfying search condition
}
到
}
//here there is code for product box of each product satisfying search condition
MVC不像Web Forms(整个页面都在表单中),您可以安全地将部分放在表单之外。