HTML Element Helpers:
- Html.TextBoxFor()
- Html.TextAreaFor()
- Html.DropDownListFor()
- Html.CheckboxFor()
- Html.RadioButtonFor()
- Html.ListBoxFor()
- Html.PasswordFor()
- Html.HiddenFor()
- Html.LabelFor()
Other Helpers:
- Html.EditorFor()
- Html.DisplayFor()
- Html.DisplayTextFor()
- Html.ValidationMessageFor()
public class MyModel
{
[Display(Name="My property title")
public class MyProperty{get;set;}
}
Html.LabelFor(x=>x.MyProperty) 該輸出結果爲
My property title,因爲設置了DisplayNmae屬性
@Html.TextBoxFor(m => m.Email, new { @class = "form-control", @readonly = true })
3、xx與xxFor的另一區別