software master at the intersection of technology, science and art

home

download

html helpers


The HtmlHelper class renders HTML controls. They encapsulate repetive HTML code for standard HTML and binds to view data or the underlying model. The sample below uses razor and assumes a model of Students.



@Html.ActionLink("Create New","Create")


is rednered as :


<a href="Student/Create"%&tCreate New </a>


There are also matching strongly typed methods. For example:

@Html.TextBox() renders <input type="text" value="">


@Html.TextBoxFor(x => x.StudentName) renders <input id="studentName" name="StudentName" type="text" value="">