LoadPostData and html <select> with multiple selections

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default LoadPostData and html <select> with multiple selections

    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?
    studen771 Guest

  2. Similar Questions and Discussions

    1. datagrid multiple selections
      How do i go about dealing with multiple selections within a datagrid? Any tutorials or examples. Thanks Dave
    2. Multiple Selections
      I have a multiple dropdown which have multiple selection. If I select multiple value on my multiple dropdown list and submit it,how can i write...
    3. HTTPService with multiple selections?
      I have a form with a list of criteria that I need to send to the server for processing. Does anyone know how to send it with an HTTPService ? I have...
    4. HTML::Form, Multiple select Elements with Same name
      Hi all, I have a form that has multiple <select> elements that have the same name. This is so that the destination script can deal with all of...
    5. php and html forms: select multiple default selected from php/mysql
      hi, i'm pretty new to all this, so bear with me.... i want to call from the database the total number of options for a select box (from table...
  3. #2

    Default Re: LoadPostData and html <select> with multiple selections

    > 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.


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


    Gaurav Vaish \(www.EduJiniOnline.com\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139