A depressing problem with ListBox!

Source: Internet
Author: User

A depressing problem with ListBox! I wasted more than an hour! Very depressed ......

Generated Code For example:
<Select name = "inc_client_accessmanage1: listbox1" size = "5" multiple = "multiple" id = "inc_client_accessmanage#listbox1" class = "s_verdana" style = "width: 240px;">
<Option value = "-1"> & lt; ---- new group name ---- & gt; </option>
<Option value = "89"> apple_002 </option>
<Option value = "-1"> & lt; ---- New group2 ---- & gt; </option>
<Option value = "6"> country </option>
<Option value = "-1"> & lt; ---- China office ---- & gt; </option>
<Option value = "88"> apple_001 </option>
<Option value = "188"> tempuser2 </option>
<Option value = "189"> country. Wu </option>
<Option value = "190"> country. wu2 </option> </SELECT>
After debugging, it is found that if you select the options of value =-1, the value obtained by using selectedindex will be 0!
I was puzzled and later found that all the options with the same value would be the selectedindex of the first option, which is unreasonable, later I had to change it to this !!!!! Depressing things .....
<Select name = "inc_client_accessmanage1: listbox1" size = "5" multiple = "multiple" id = "inc_client_accessmanage#listbox1" class = "s_verdana" style = "width: 240px;">
<Option value = "-1"> & lt; ---- new group name ---- & gt; </option>
<Option value = "89"> apple_002 </option>
<Option value = "-2"> & lt; ---- New group2 ---- & gt; </option>
<Option value = "6"> country </option>
<Option value = "-3"> & lt; ---- China office ---- & gt; </option>
<Option value = "88"> apple_001 </option>
<Option value = "188"> tempuser2 </option>
<Option value = "189"> country. Wu </option>
<Option value = "190"> country. wu2 </option> </SELECT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.