Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have checkboxlist in my webpage . I also set autopostback property to true.

When I select any item in the checkbox. The selectedindexchanged event is not getting fired.

Where I am going wrong.

XML
<asp:CheckBoxList
                    ID="chkdecisionlist" runat="server"
                    RepeatLayout="OrderedList" AutoPostBack="True"
                    OnSelectedIndexChanged="chkdecisionlist_SelectedIndexChanged">

                    <asp:ListItem>Preview Weekend or Preview Day </asp:ListItem>
                    <asp:ListItem>Newspaper/Magazine Ad </asp:ListItem>
                    <asp:ListItem>Social Networking </asp:ListItem>
                    <asp:ListItem>MBA/Higher Education Fair </asp:ListItem>
                    <asp:ListItem>Rankings</asp:ListItem>
                    <asp:ListItem>Other Media </asp:ListItem>
                </asp:CheckBoxList>


Thanks,

Rajesh
Posted
Updated 6-Oct-13 21:55pm
v2

1 solution

Use update panel like below :

XML
<asp:UpdatePanel ID="Up" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:CheckBoxList
                    ID="chkdecisionlist" runat="server"
                    RepeatLayout="OrderedList" AutoPostBack="True"
                    OnSelectedIndexChanged="chkdecisionlist_SelectedIndexChanged">

                    <asp:ListItem>Preview Weekend or Preview Day </asp:ListItem>
                    <asp:ListItem>Newspaper/Magazine Ad </asp:ListItem>
                    <asp:ListItem>Social Networking </asp:ListItem>
                    <asp:ListItem>MBA/Higher Education Fair </asp:ListItem>
                    <asp:ListItem>Rankings</asp:ListItem>
                    <asp:ListItem>Other Media </asp:ListItem>
                </asp:CheckBoxList>
    </ContentTemplate>
</asp:UpdatePanel>


If still its not solve then use trigger in update panel.
Accept and vote if help to you.
 
Share this answer
 
Comments
rajeshkool 7-Oct-13 5:27am    
@jaideepsinh. I worked out your suggestion but its not working. I tried using triggers too.
<asp:UpdatePanel ID="Up" runat="server" UpdateMode="Conditional">
<contenttemplate>
<asp:CheckBoxList ID="chkdecisionlist" runat="server"
AutoPostBack="True"
OnSelectedIndexChanged="chkdecisionlist_SelectedIndexChanged">

<asp:ListItem>Preview Weekend or Preview Day
<asp:ListItem>Newspaper/Magazine Ad
<asp:ListItem>Social Networking
<asp:ListItem>MBA/Higher Education Fair
<asp:ListItem>Rankings
<asp:ListItem>Other Media


<Triggers>
<asp:AsyncPostBackTrigger ControlID="chkdecisionlist" EventName="SelectedIndexChanged" />
</Triggers>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900