Explain the usage of validation helpers in ASP.NET MVC ?

 Posted by Bharathi Cherukuri on 8/27/2012 | Category: ASP.NET MVC Interview questions | Views: 4683 | Points: 40

In ASP.NET MVC, validation helpers are used to show the validation error messages in a view.
The Html.ValidationMessage() and Html.ValidationSummary() helpers are used in the automatically generated Edit and Create views by the ASP.NET MVC.
To create a view, the following steps are to be followed:

i) In the product controller,right click on the Create() action and then select the option Add View.
ii) Now check the checkbox labeled in the Add View dialog and create a strongly-typed view.
iii) Select the product class from the View data class dropdownlist.
iv) Now, select Create from the view content dropdownlist.
v) Finally, click on the Add button.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response