我想爲ActionResult方法創建一個可選參數。方法的MVC可選參數
我有以下幾點:
public ActionResult ViewReq (int id, string Req = null)
當我試圖做到以下幾點:
http://localhost/RepMedia/Controller1/ViewReq?id=34343?Req="34233"
我嘗試以下,但得到了一個錯誤:
An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters
我不是確定我做錯了什麼。