Click here to Skip to main content
15,922,650 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource1"
           DataTextField="mname"    DataValueField="monthid"
           RepeatDirection="Horizontal">
   </asp:CheckBoxList>

XML
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
         ConnectionString="<%$ ConnectionStrings:myconnection %>"
         SelectCommand="select monthid,mname from months where monthid not in(SELECT   mnameid
                      FROM         InstallmentItem INNER JOIN Installment
                        ON InstallmentItem.InstallmentID = Installment.InstallmentID
                     AND InstallmentItem.SessionID = Installment.SessionID
                     Where (InstallmentItem.SessionID =@sss) )">

                <SelectParameters>
                    <asp:ControlParameter ControlID="HiddenField1" Name="sss"
                        PropertyName="Value" />
                </SelectParameters>
            </asp:SqlDataSource>
Posted
Comments
sid31988 2-Apr-14 9:08am    
Does your page contains AJAX update panel or it works on simple postback. Because the solution would change if there is AJAX update panel in use.

check your AutopostBack property
C#
 AutoPostBack="true"
<asp:checkboxlist id="CheckBoxList1" runat="server" datasourceid="SqlDataSource1" 
           DataTextField="mname" AutoPostBack="true"   DataValueField="monthid"
           RepeatDirection="Horizontal">
   </asp:checkboxlist>

for more check this link
http://asp-net-example.blogspot.in/2009/03/how-to-use-autopostback-feature-in.html[^]
 
Share this answer
 
v2
In the client event handler of your button, call the DataBind() method of your checkboxlist control.

For example:

C#
CheckBoxList1.DataBind();
 
Share this answer
 

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