0
using Strongly Typed Html Helpers will map the model to the view and it will help to have compile time checking of the views.
in views instead of using
you can use
in controller:
use
moreover you dont need to use ValueProvider["UserName"].AttemptedValue to access Html value and you can use model directly.
and for adding attribute
using Strongly Typed Html Helpers will map the model to the view and it will help to have compile time checking of the views.
in views instead of using
<%=Html.TextBox("username", Model.UserName)%>
you can use
<%= Html.TextBoxFor( m => m.UserName)%>
in controller:
public ActionResult LogOn(string userName, string password)
use
public ActionResult LogOn(LoginViewModel loginviewModel)
moreover you dont need to use ValueProvider["UserName"].AttemptedValue to access Html value and you can use model directly.
and for adding attribute
<%= Html.TextBoxFor(model => model.UserName , new { @calss="SingleTextBox" }) %>
Post a Comment