DropDownList -dissalow first item

  • Thread starter Thread starter jhoge123
  • Start date Start date
J

jhoge123

Is there an easy way to create a dropdownlist with a "Please Choose"
message in the first item that is disabled?

I would prefer to handle this on the client side, so that the
DropDownList autopostback is disabled when the user chooses the first
item.

My guess is that there is some simple javascript I can attach as a
client side event.
 
[VB.NET]

Sub Page_Load
If Not IsPostBack Then
lstDropDown.Item.Add("Please Choose An Item")
lstDropDown.SelectedItem.Value = ""
End If
 
This is probably a bad design decision, but you could just set the
Enabled bool falue to flase.
 
Back
Top