Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if dropdownlist contains 0 or is empty in asp.net using c#?

Tags:

asp.net

c#-3.0

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 want the user to manually input the value. Can it be possible? If yes how? thanks.

like image 886
RachitSharma Avatar asked Oct 22 '13 12:10

RachitSharma


1 Answers

Use

if (ddl.Items.Count == 0) { txt.Enabled = true; } 
like image 120
milan m Avatar answered Oct 05 '22 18:10

milan m