繁体   English   中英

没有自动回发的SelectedIndexChanged事件为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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM