ListItem attributes in DropDownList not being persisted

B

Bob Krug

I have a DropDownList control to which I am adding 2 ListItems. For each
List Item I am setting the Value and Text as well as adding an attribute.
My code looks something like this:

Dim objItem as new ListItem
objItem.value = "1"
objItem.Text = "Value 1"
objItem.attributes("CrossRefValue") = "A"

MyDropList.items.add(objItem)

I do the same thing for the second item in the drop list. The problem is
that the attributes no longer exist after postback. The text & value
properties are still there, but no attributes. If I apply attributes to a
TextBox they persist between postbacks, why not the list items? Are
attributes not really supported for drop list items? I looked at the html
source of the rendered page and I don't see my attributes as part of the
"options" tag of the select object.

Thanks,
Bob
 
B

Bob Krug

Yes. Probably should have mentioned that, but I do have viewstate = true.
The list item values/text are coming back fine.
 
J

Jacob Yang [MSFT]

Hi Bob,

Based on my research and experience, this issue is a limitation. Please
refer to the following URL for the detailed information:

http://www.dotnet247.com/247reference/msgs/13/68348.aspx

Does it answer your question?

If I have misunderstood your concern, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bob Krug

Yes, that is the information I am looking for! The only other question is
how do I find out when the problem has been fixed? I would like to stop
using my "custom" drop list when MS has fixed the limitation - Is there some
sort of mailing list I can get on for resolution of known issues?

Thanks,
Bob
 
J

Jacob Yang [MSFT]

Hi Bob,

I am very glad to know that the information is helpful to you. For your
last question, unfortunately, there is not such a mailing list. In general,
there will be a published Knowledge Base article when a known issue is
fixed. Please pay more attention to the Microsoft Web Site. Thank you for
your understanding.

In addition, you can send feedback for our products via the following URL:

http://register.microsoft.com/mswish/suggestion.asp?&SD=GN&LN=EN-US&gssnb=1

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jacob Yang [MSFT]

Hi Bob,

Please pardon my last post. I wrote "Please pay more attention to the
Microsoft Web Site". I realize that our web site is too large to watch
closely. I have an additional suggestion for you. Watch for updates to the
NET framework, such as service packs. Each time you install one, retest
this issue.

With this you have two ways to watch for this being fixed; watch for an
article and retest after installing updates. Between these methods, you
should become aware of the fix shortly after it is made available.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top