Using a dash (-) in ASP.MVC parameters

后端 未结 5 1463
失恋的感觉
失恋的感觉 2020-12-05 08:26
<% using (Html.BeginForm(\"SubmitUserName\")) { %>
    
    
<         


        
5条回答
  •  渐次进展
    2020-12-05 09:08

    Create a pseudo-parameter in the first line of the action method:

    public ActionResult SubmitUserName()
    {
        string userName = Request.Params["user-name"];
        ...
    }
    

提交回复
热议问题