开发者

asp.net getting list of items selected

i h开发者_C百科ave a combobox:

<select size="8" multiple="true" >
                <optgroup label="Europe">
                    <option>United Kingdom</option>
                    <option>Luxembourg</option>
                </optgroup>    
                <optgroup label="Asia">
                    <option>India</option>
                    <option>Dubai</option>
                </optgroup>
            </select>

i would like to know how i can return to the asp.net application which entries were selected by the user?


A developer created a server-side control to do this: http://weblogs.asp.net/jeff/archive/2006/12/27/dropdownlist-with-optgroup.aspx

Try adding runat="server" and see what that gives you. You should be able to access from the server some of its attributes, but I'm not sure how that all works with option groups.

As a last resort, if you have to, create an <asp:HiddenField /> control and use JS to store the store the selections there.

HTH.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜