<asp:CheckBox ID="chkBox1" runat="server" Text="1" />
<asp:CheckBox ID="chkBox2" runat="server" Text="2" />
I have two checkbox, Based up on the Selection i need to run query and bind into repeater control.
In Repeater Control:
<asp:Repeater runat="server" ID="Repeater1">
<HeaderTemplate >
<table class="list_table" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th>1</th>
<th>2</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%=CheckBox1.Checked ? Eval("1") : "" %></td>
<td><%=CheckBox2.Checked ? Eval("2") : "" %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
AVD suggestion i have changed my coding, if condition is working fine, but i need to bind the data from database into the repeater control.
You can try,
EDIT:
@Prince Antony G : If I select checkbox1 then run the query- select 1 from table1; or if I select checkbox2 then run the query- select 2 from table2; and bind the data into my repeater control (and both these tables have different fields)
You can’t bound different data source to a DataControl because some of the binding expression (columns) are not available(found) in either of that case.
Page1.aspx markup
Page1.aspx.cs – code behind