For an ASP.NET MVC application, can someone explain to me why calls to Html.BeginForm
begin with the statement @using
?
Example -
Using Statement provides a convenient syntax that ensures the correct use of IDisposable
objects. Since the BeginForm
helper implements the IDisposable
interface you can use the using
keyword with it. In that case, the method renders the closing tag at the end of the statement. You can also use the
BeginForm
without using
block, but then you need to mark the end of the form:
@{ Html.BeginForm(); }
//Stuff in the form
@{ Html.EndForm(); }