What is the benefit to using Html.BeginForm?
We’re having some issues related to html helpers and razor generator view testing and I’m struggling to see the benefit which would stop us going back to old skool form tags.
Has anyone got an argument for or against either?
by old skool i mean:
<form action="@Url.Action('Blah')">
The
Html.BeginFormis useful because it generates the url using the routes defined in the Global.asax. (or you can extend it with your own code)Using the old tag is neither worst or best in my opinion. You simply have to generate your url manually or using the Url helper. In the end the html in the page will be the same