页面:
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server" Height="162px" HorizontalAlign="Center"
Width="686px">
<asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" Height="143px" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged" SelectionMode="Multiple">
<asp:ListItem Value="1">first</asp:ListItem>
<asp:ListItem Value="2">second</asp:ListItem>
<asp:ListItem Value="3">third</asp:ListItem>
<asp:ListItem Value="4">forth</asp:ListItem>
<asp:ListItem Value="5">firth</asp:ListItem>
<asp:ListItem Value="6">sirth</asp:ListItem>
<asp:ListItem Value="7">seventh</asp:ListItem>
</asp:ListBox><br />
<asp:Label ID="Label1" runat="server" Text="Label" Width="74px"></asp:Label></asp:Panel>
</div>
</form>
</body>
C#程序
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Label1.Text = ListBox1.SelectedItem.Value;
}
是这样子的,比如以上程序.我按住ctrl多选,选择的顺序是1,2,3,4,5,6,7.
但是得到的selecteditem.value始终是1.如果我的选择顺序是7,6,5,4,3,2,1.那么selecteditem.value的值就会跟着变化7,6,5,4.....
我现在就是想把我当前选的项的selecteditem.value取出来.比如,我选1,2,3,到3这里selecteditem.value为3,但是它却为1.
这就是我的问题了.
各位高手再看看.谢谢!