creating custom html helpers in asp.net mvc

Post on 06-Aug-2015

236 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Custom HTML Helpers in ASP.NET MVC

Lohith G N

About Me

Technical EvangelistMicrosoft MVP (ASP.NET/IIS)

lohith.nagaraj@telerik.com

@kashyapahttp://www.kashyapas.com

http://www.telerikhelper.net

Lohith G N

http://www.telerik.com

Agenda

• Understanding HTML Helpers

• Standard Helpers in ASP.NET MVC

• Writing Custom Helpers

Understanding HTML Helpers

HTML Helpers

Source: Wikipedia

• Method that returns String

• Avoid tedious typing of HTML Tags

• Render any content using Helpers

Standard Helpers in MVC

Standard HTML Helpers

• @Html.Label(), @Html.LabelFor()

• @Html.TextBox(), @Html.TextBoxFor()

• @Html.TextBox(), @Html.TextBoxFor()

• @Html.DropDownList(), @Html.DropDownListFor()• …

Demo

Custom HTML Helpers

Developing Custom HTML Helpers

• @helper

• Static Methods

• Extension Methods

• Fluent Extension Methods

Demo

Thanks !

Lohith.Nagaraj@Telerik.com

top related