0
 @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
}

所有产品都作为查询字符串传递,有什么方法可以避免吗?例如

http:\localhost:54632\mysite\q=糖&糖 5kg=1&无糖=1.......

搜索结果中的所有产品都添加到查询字符串中

谢谢

4

1 回答 1

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 表单(您的整个页面都在一个表单中),您可以安全地将部分放在表单之外。

于 2013-06-18T13:25:13.160 回答