1

In my application I have used list box as multiselect mode. I need to Fire SelectedIndexChanged event for list box without using

autopostback(AutoPostBack=True)

in c#. How can I do that?

GrandMasterFlush
  • 6,269
  • 19
  • 81
  • 104
user3295668
  • 11
  • 1
  • 2
  • 1
    Possible duplicate of http://stackoverflow.com/questions/5729160/how-to-fire-dropdownlists-selectedindexchanged-without-postback and http://stackoverflow.com/questions/22022422/how-dropdownlists-selectedindexchanged-works-without-postback – alan Apr 17 '14 at 12:21
  • What are you trying to accomplish, so we might be able to give you a possible solution? – InbetweenWeekends Apr 17 '14 at 12:28

1 Answers1

0

Take your List Box into update panel, see below:

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