【问题标题】:Get method passing all values on form mvc3获取在表单 mvc3 上传递所有值的方法
【发布时间】:2013-06-18 13:20:15
【问题描述】:
 @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=sugar&sugar 5kg=1&sugar free=1.......

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

感谢

【问题讨论】:

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


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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 1970-01-01
      相关资源
      最近更新 更多