Click here to Skip to main content
15,921,203 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Design screen as follows

Label (To show the message)

Faculty Name Dropdownlist

Month Dropdownlist

Year Dropdownlist

I have one button Show

When i click the Show button i want to validate if any of the above Faculty Name,Month and Year
is not selected.

i want to show the message in label.

For example if faculty name is not selected show the message Faculty Name is not selected.

for that how can i vaidate in asp.net using csharp.

regards,
narasiman P.
Posted
Comments
Thanks7872 30-Sep-13 8:27am    
Do you have access to google.com?

Simply check if the value in dropdown is not null.
C#
if(ComboBox.SelectedItem == null)
    //do something about it
 
Share this answer
 
Try RequiredFieldValidator:

http://www.w3schools.com/aspnet/control_reqfieldvalidator.asp[^]

All the best.

Azee...
 
Share this answer
 
Refer below article

Introduction to ASP.NET validation[^]
 
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