Hello if i wnat to call the following script after check the ModelState property in the controller in order to ensure validation, how can i implment this :
the view also contatin beginForm that will be associated to action in controller to check ModelState:
- @using (Html.BeginForm("LoginProcess", "Login"))
- {
- class="container">class="row">class="col-md-6 col-md-offset-3 alert alert-warning">class="row">class="col-md-12">class="form-group">
- @Html.LabelFor(c => c.Customers.Name)
- @Html.TextBoxFor(c => c.Customers.Name, new { @class = "form-control" })
- @Html.ValidationMessageFor(c => c.Customers.Name)
class="form-group">- @Html.LabelFor(c => c.Customers.Password)
- @Html.TextBoxFor(c => c.Customers.Password, new { @class = "form-control" })
- @Html.ValidationMessageFor(c => c.Customers.Password)
- @Html.AntiForgeryToken()
- class="btn btn-primary">Save
- }

Ehsan SajjadRank #512 · 4.8K reputationPosted Mar 7, 2017, 9:14 PM EST
Joginder BangerRank #360 · 7K reputationPosted Mar 7, 2017, 3:57 AM EST
Fares AyyadRank #9,604 · 204 reputationPosted Mar 7, 2017, 5:08 AM EST