O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Built-in Helper Methods

Now that we have seen how helper methods work, we can look at the built-in helpers that the MVC framework provides. We have already encountered some of these helpers in earlier examples, but this is the part of the book where we can look at them in depth.

images Note The built-in helpers automatically encode data values to make them safe to display in a browser.

Creating Forms

One of the most frequently used helper methods is Html.BeginForm, which lets us create an HTML form element. This helper is used in a special way, as shown in Listing 26-4.

Listing 26-4. Using the Html.BeginForm helper

@using (Html.BeginForm()) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required