62,182
社区成员
发帖
与我相关
我的任务
分享
protected void Button1_Click(object sender, EventArgs e)
{
//获得选中的索引数组
int[] select = this.ListBox1.GetSelectedIndices();
//控件集合
ListItemCollection items = this.ListBox1.Items;
string str = "";
foreach (int i in select)
{
str += items[i].Value + ",";
}
Response.Write("<script>alert('"+str+"')</script>");
}