artdvp
9/7/2017 - 3:14 PM

ASP.NET MVC 5 Form

@using (Html.BeginForm()) {
   ...
   <input name="Save" type="submit" value="Save" />
}

@using (Html.BeginForm("MyController", "MyAction")) {
   ...
   <input name="Save" type="submit" value="Save" />
}

<!--It generates this output:-->

<form action="/MyController/MyAction/Invalid#name%x" method="post">
   ...
   <input name="Save" type="submit" value="Save" />
</form>

<form action="/MyController/MyAction/Invalid%23name%25x" method="post">
   ...
   <input name="Save" type="submit" value="Save" />
</form>