[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

ListItem.AddAttributes has no affect?

PV

3/1/2004 10:14:00 PM

I am trying to add some attributes to a DropDownList's list items.

For Example
dropdownList1.Items[0].Attributes.Add("myExpandoProperty",
"myExpandoValue");

I would expect then the rendered html to look like:

<select name="dropdownList1" id="dropdownList1">
<option value="test" myExpandoProperty="myExpandoValue">test</option>
</select>

However, the expando property does not show up. What's the point of having
an attributes collection if it does not get rendered in the HTML!?

Any idea how to do this?


1 Answer

Alvin Bruney

3/1/2004 11:07:00 PM

0

That's a well documented bug. There is currently no work around.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl...
"PV" <philipv-REMOVE-TO-REPLY@computronix.com> wrote in message
news:uwxCzp9$DHA.3824@TK2MSFTNGP09.phx.gbl...
> I am trying to add some attributes to a DropDownList's list items.
>
> For Example
> dropdownList1.Items[0].Attributes.Add("myExpandoProperty",
> "myExpandoValue");
>
> I would expect then the rendered html to look like:
>
> <select name="dropdownList1" id="dropdownList1">
> <option value="test" myExpandoProperty="myExpandoValue">test</option>
> </select>
>
> However, the expando property does not show up. What's the point of
having
> an attributes collection if it does not get rendered in the HTML!?
>
> Any idea how to do this?
>
>