boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

List of HTML Helpers For Forms In Razor Web Pages

Updated on     Kisan Patel

There are several Input elements in ASP.NET MVC Razor view you can use them differently. Here we are list out HTML Helpers For Forms In Razor Web Pages.

  1. LabelFor
  2. DropDownListFor
  3. TextBoxFor
  4. EditorFor
  5. TextAreaFor
  6. ValidateFor
  7. RadioButtonFor
  8. CheckBoxFor
  9. HiddenFor
  10. DisplayFor
  11. PasswordFor

1. LabelFor :

LabelFor is used to give label for your model property , It will display name of Your property but if you have given [Display(name=”abc”)] then it will display abc as a label of your property.

@Html.LabelFor(model => model.Contact)

2. DropDownListFor :

DropDownListFor is used for fill Dropdown values in it.

@Html.DropDownList("dropRoles", new List()
{
   new SelectListItem() { Text= "Yes", Value = "true" },
   new SelectListItem() { Text= "No", Value = "false", Selected = true }
}, "Select ...")

OR

@Html.DropDownList("MultipleTables", ViewBag.Roles as SelectList)

3. TextBoxFor :

TextBoxFor is used for textbox in form we can apply class css on it but can’t do it on Editorfor.

@Html.TextBox("FirstName", "Value Optional")

OR

@Html.TextBoxFor(model => model.FirstName)

4. EditorFor :

EditorFor is also same as TextboxFor but we can not apply css on it.

@Html.EditorFor(model => model.FirstName)

5. TextAreaFor :

TextAreaFor is used for textarea for model to write some text with number of rows and cols

@Html.TextAreaFor(model => model.FirstName)

6. ValidateFor :

ValidatoinFor is used for validation message display for any models property.

@Html.ValidationMessageFor(model => model.Contact)

7. RadioButtonFor :

RadioButtonFor is used for Radio buttons in form .

@Html.RadioButton("Active", "true") Yes
@Html.RadioButton("Active", "false", true) No

8. CheckBoxFor :

CheckBoxFor is used for checkbox in form

@Html.CheckBoxFor(model => model.Active)

OR

@Html.CheckBox("Active")

9. HiddenFor :

HiddenFor is used for hidden value which value we want to pass it in postback.

@Html.Hidden("Name", "Value Optional")

OR

@Html.HiddenFor(model => model.AutoId)

10. DisplayFor :

DisplayFor is used to display value of property. but it can not be passed in the postback function.so thats why we use HiddenFor to get that value

@Html.DisplayFor(model => model.Contact)

11. PasswordFor :

PasswordFor is used while writing the password field while writing the password

@Html.PasswordFor(model => model.Contact)

ASP.NET MVC

Leave a Reply