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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top