What is HTML Helpers in Asp.Net MVC ?

Here I am explaining about What is HTML Helpers in Asp.Net MVC ? Differnce between HTML Helpers and asp.net web form control.HTML helpers are just like ASP.NET Web Form controls which used to modify HTML. But HTML helpers are more lightweight comaparing to ASP.NET Web Form controls. Unlike Web Form controls, an HTML helper does not have an event model and a view state.HTML Helper methods are nothing more than methods that are returning string.

If you want to write your own Html Helper method you have to write extension methods for HtmlHelper class. ASP.NET MVC Framework itself contains extension methods for HtmlHelper class to have well structured helper methods separation.You need to add the namespace System.Web.Mvc.Html inorder to work with ASP.NET MVC Framework Html Helper extension.
Rendering Links

The easiest way to render an HTML link in a view is to use the HTML.ActionLink() helper. The Html.ActionLink() does not link to a view. Instead, you use the Html.ActionLink() helper to create a link to a controller action.


The Html.ActionLink() helper as several properties:Untitled

Leave a Reply

Your email address will not be published. Required fields are marked *