Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can I give validations to the dropdown list in mvc.
Posted

1 solution

Hi..


You can use data annotation validation in MVC.

like

C#
[Required(ErrorMessage = "Please select at least one option")]
    public int ddlId{ get; set; }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900