Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How to get the count in the dropdown values.
when I use
dropdownlist.items.count =0
then it is always showing the values.

see my code below.

VB
If drpBrandName.Items.Count = 0 Then
                Else
                    Dim myscript As String = "alert('Select Brand Name');"
                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType(), "myscript", myscript, True)
                    drpBrandName.Focus()
                    Exit Sub
                End If


please. help.

I want, if dropdown count is "Zero" then it should not validate otherwise, it should validate.

give me the solution.

Regards,
Ganesh.S
Posted
Updated 9-Jun-11 3:41am
v3

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