Thanks in advance to anyone else who can help :)
I've got a custom control that contains a PLAIN HTML <select> element that
allows multiple selections (NOT A asp.net listbox, listcontrol or
derivatives, etc.)
Within the LoadPostData method I'm trying to retrieve the values that were
chosen from the <select> element, yet the NameValueCollection parameter that
this method passes only allows for single strings, NOT collections..(at least
to my understanding up to this point)
How is it possible for me to retrieve the items selected out of my <select>
html element in the LoadPostData method when its second parameter
(NameValueCollection xxx) only accepts strings?
Gaurav Vaish (www.EduJiniOnline.com) - 24 Sep 2006 05:32 GMT
> How is it possible for me to retrieve the items selected out of my
> <select>
> html element in the LoadPostData method when its second parameter
> (NameValueCollection xxx) only accepts strings?
The value for the corresponding key contains the entries as a string but in
a comma-separated form.
You may simply do:
string[] allSelectedValues = postCollection.GetValues(postDataKey);
If no values were selected, the array will be null.

Signature
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------