Simple html vs extension methods in Razor (preference)
问题 For Simple tags in MVC Razor do you prefer to use simple HTML or use extension methods eg <label for="male">Male</label> Or @Html.Label("male", "Male") I feel it is sometime more easier to use the simple HTML. Extension methods make sense when you want to do some custom code. 回答1: Depends. If the male element you are associating this label to is rendered with a html helper like: @Html.TextBoxFor(x => x.Male) then I would use a Html.LabelFor and keep the lambdas and strong typing. Also I would