我有2个索引操作POST和GET当我提交的表单POST操作返回:获取URL ASP.NET MVC 3
return RedirectToAction("Index");
编辑:
我得到索引操作可以获取一些参数来支持搜索和过滤返回的List。像这样:
public ActionResult Index(string search = "", long searchItem = 0, long RC = 0, long Page = 1)
我用分页目录,有一个DropDownList
,显示行数在每页,我写form.submited一个jQuery脚本改变这个下拉菜单中,当形式RedirectTAction
提交 我输了我的参数如下代码:
[HttpPost]
public ActionResult Index(FormCollection collection, string search = "") {
long RowCount = 0;
long.TryParse(string.Format("{0}", collection["RowCount"]), out RowCount);
//More implement
return RedirectToAction("Index", new { RC = RowCount, search = search, searchItem = Id });
那么有没有什么办法可以在Post Action中获取Url或url参数?你在这种情况下的建议是什么?
什么是url参数?通常当你POST时,没有查询字符串参数。或者有你的情况吗?你在说什么查询字符串参数或路由值或POST值? – 2012-04-17 09:47:57
@DarinDimitrov我更新问题 – Saeid 2012-04-17 09:58:12