JS代码:

1 var listbox = document.getElementById("<%=lbCustom.ClientID %>");
2  var values = "";
3 if (listbox.options.length > 0) {
4       for (var i = 0; i < listbox.options.length; i++) {
5            values += listbox.options[i].value;
6            values += ",";
7     }
8  }
9  values = values.replace(/,$/, "");//消除最后一个,

 

aspx代码:

1 <asp:ListBox ID="lbCustom" runat="server" Height="310px" Width="210px"  SelectionMode="Multiple" ></asp:ListBox>

 

相关文章:

  • 2021-12-21
  • 2021-10-13
  • 2021-08-19
  • 2022-12-23
  • 2021-12-03
  • 2021-12-31
猜你喜欢
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案