我有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