Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have a dropdown list that has multiple values that i am getting from my stored procedure. But there can be a case that my dropdown remains empty. so in that case i need to validate and redirect to next Page.

Any code will be appreciated.

Thanks
Posted
Comments
ZurdoDev 5-Nov-14 12:06pm    
See Solution 1; however, this should have been pretty easy for you to find. Just use Intellisense and you'll be able to teach yourself much faster than having to go ask other people. And you'll learn more that way.

1 solution

C#
if (dropdownlist.Items.Count < 1)
{
   //no items 
}
 
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