我正在嘗試使用Html.ActionLink在其末尾生成帶有查詢字串引數的 URL,例如:
Controller/Action?id=5
但我得到的是:
Controller/Action/5
使用 :
@Html.ActionLink((string)ViewBag.Back, "Action", "Controller", new{id = Model.Id }, new { })
我怎樣才能將 id 引數作為“?id =”而不是在“/”之后傳遞謝謝
uj5u.com熱心網友回復:
更改動作標題
public ActionResult Details(int? detailsId)
并調整鏈接
Html.ActionLink((string)ViewBag.Back, "Action", "Controller", new{detailsId = Model.Id }, new { })
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/421543.html
標籤:
下一篇:使用ADFS方法進行單點登錄
