Using Html.BeginForm with querystring

前端 未结 7 1592
无人共我
无人共我 2021-01-01 09:44

My url looks like this:

customer/login?ReturnUrl=home

In the login view, I have used this pattern of code which works fine.



        
7条回答
  •  悲&欢浪女
    2021-01-01 10:21

    Just incase you wanted to add other attributes as well. use below code

    @using (Html.BeginForm("actionName", "controllerName", routeValues: new { lang = "en" }, method:FormMethod.Post, htmlAttributes: new { @class= "my-form", enctype = "multipart/form-data" }))
    

提交回复
热议问题