Login.chtml:

<tr> <td>@Html.Label(a => a.UserName)</td> <td>@Html.TextBox(a => a.UserName)</td> <td>@Html.ValidationMessage(a => a.UserName)</td> </tr> 
  • and where is the entity framework? - Grundy

1 answer 1

You use one group of extension methods ( Label, TextBox, ValidationMessage ), and you LabelFor, TextBoxFor, ValidationMessageFor parameters for the group ( LabelFor, TextBoxFor, ValidationMessageFor ).

Try this code

 <tr> <td>@Html.LabelFor(a => a.UserName)</td> <td>@Html.TextBoxFor(a => a.UserName)</td> <td>@Html.ValidationMessageFor(a => a.UserName)</td> 

  • But it really works - GhostBasenji