获取方法传递表单mvc3上的所有值

时间:2013-06-18 13:20:16

标签: asp.net asp.net-mvc-3 razor

 @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 ..............

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

感谢名单

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