Q:

ASP.Net Dropdownlist ListItem (Enabled=false) not showing in page

I have a dropdownlist in aspx called ddlService.
I want to added the listitems from behind.
When I add, I will create them in order of Title and items underneath like..
Title1
Item1
Item2
Title2
Item1
Item2

Titles should not be able to click. Only Items should be able to click.
ListItem tempServicesItem = new ListItem();
tempServicesItem.Text = tempTitle;
tempServicesItem.Value = tempTitle;
tempServicesItem.Enabled = false;     
ddlServices.Items.Add(tempServicesItem);
tempServicesItem = new ListItem();
tempServicesItem.Text = tempItem;
tempServicesItem.Value = tempItem;                                                        
ddlServices.Items.Add(tempServicesItem);

The problem I encountered is The ListItems with (Enabled=false) are not appearing in aspx.
When I change it to (Enabled=true), it is appearing.
I must have missed out something. Can anyone point out?
Thanks.

A:

I believe this is what you're looking for. (Not tested)
tempServicesItem.Attributes.Add("disabled", "disabled");

