HTML Helpers
1. Standard HTML Helpers
@Html.TextBox("name")@Html.TextBoxFor(model => model.PropertyName)@Html.Label("name", "Label Text")@Html.LabelFor(model => model.PropertyName)@Html.DropDownList("name", new SelectList(ViewBag.Options))@Html.DropDownListFor(model => model.PropertyName, new SelectList(Model.Options))@Html.CheckBox("name")@Html.CheckBoxFor(model => model.PropertyName)@Html.RadioButton("name", "value")@Html.RadioButtonFor(model => model.PropertyName, "value")@Html.ValidationMessage("name")@Html.ValidationMessageFor(model => model.PropertyName)
2. Templated HTML Helpers
3. Custom HTML Helpers
4. Using HTML Helpers in Razor Views
Benefits of Using Custom HTML Helpers
Last updated