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

StackOverflow https://stackoverflow.com/questions/19518362

  •  01-07-2022
  •  | 
  •  

Вопрос

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.

Это было полезно?

Решение

Use

if (ddl.Items.Count == 0) { txt.Enabled = true; } 
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top