<% using(Html.BeginForm()) { %>
...
<% } %>
OR
<% Html.BeginForm(); %>
...
<% Html.EndForm(); %>
What are the advantages/disadvantages of using both ways to use Html.BeginForm?
<% using(Html.BeginForm()) { %>
...
<% } %>
OR
<% Html.BeginForm(); %>
...
<% Html.EndForm(); %>
What are the advantages/disadvantages of using both ways to use Html.BeginForm?
I prefer
<% using(Html.BeginForm()) { %>
...
<% } %>
Just to make sure I get the warning when it isn't closed. But it isn't the greatest use of the using statement.
You can find more info here. In terms of rendering, there won't be a difference.
If you are using Spark, don't use either. You can easily add your own extensions, as we've done at Logos.
<logos:using form="Html.BeginForm()">
Email: <input type="text" name="email" />
</logos:using>
or
<logos:form controller="User" action="Update" routeValues="new { id = 123 }">
Email: <logos:textbox for="Email" />
</logos:form>