![](/img/trans.png)
[英]DropDownList SelectedIndexChanged not firing (AutoPostBack=“true”)
[英]SelectedIndexChanged event without autopostback is true
在我的应用程序中,我已将列表框用作多选模式。 我需要不使用而SelectedIndexChanged event
列表框的SelectedIndexChanged event
autopostback(AutoPostBack=True)
在C#中。 我怎样才能做到这一点?
将您的列表框放入更新面板,请参见下文:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:ListBox ID="ListBox1" SelectionMode="Multiple" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged" AutoPostBack="true" runat="server">
<asp:ListItem Text="text 1" Value="0"></asp:ListItem>
<asp:ListItem Text="text 2" Value="1"></asp:ListItem>
<asp:ListItem Text="text 3" Value="2"></asp:ListItem>
<asp:ListItem Text="text 4" Value="3"></asp:ListItem>
<asp:ListItem Text="text 5" Value="4"></asp:ListItem>
</asp:ListBox>
</ContentTemplate>
</asp:UpdatePanel>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.