C# SelectedIndexChanged事件不带自动回邮为true

C# SelectedIndexChanged事件不带自动回邮为true,c#,asp.net,C#,Asp.net,在我的应用程序中,我使用列表框作为多选模式。我需要为列表框触发SelectedIndexChanged事件而不使用 autopostbackAutoPostBack=True 在c。我该怎么做 将您的列表框放入更新面板,请参见以下内容: <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel runat="server">

在我的应用程序中,我使用列表框作为多选模式。我需要为列表框触发SelectedIndexChanged事件而不使用

autopostbackAutoPostBack=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>

可能的重复项以及您试图实现的目标,以便我们能够为您提供一个可能的解决方案?Asker提到他不希望AutoPostBack=true