S
Sung
Hi,
I have a datalist contains ItemTemplate with a few controls. One of the
controls is a CheckBox control which serves as user input rather than bound
display control. When the page is submitted, I want to know the state of
every CheckBox control in the datalist. Also, I have a hidden field which is
a primary key of my SQL database table and I want to get that information as
well. My datalist is bound from database except the checkbox as following:
<asp:datalist id="CouponsList" runat="server" RepeatColumns="1" Width="600">
<ItemTemplate>
<table border="0" width="600">
<tr>
<td width="40" valign="middle">
<asp:CheckBox id="ckbSelect" runat="server"></asp:CheckBox>
</td>
<td width="2">
<asp:label class="Normal" id="lblStoreID" runat="server"
Visible="false">
<%# DataBinder.Eval(Container.DataItem, "SomeSQLTableID") %>
</asp:label>
</td>
//... other bound controls
</tr>
</table>
</ItemTemplate>
</asp:datalist>
In the behind code I check the check state and if it's selected, I get the
ID. How can I do this?
Any help would be appreciated.
I have a datalist contains ItemTemplate with a few controls. One of the
controls is a CheckBox control which serves as user input rather than bound
display control. When the page is submitted, I want to know the state of
every CheckBox control in the datalist. Also, I have a hidden field which is
a primary key of my SQL database table and I want to get that information as
well. My datalist is bound from database except the checkbox as following:
<asp:datalist id="CouponsList" runat="server" RepeatColumns="1" Width="600">
<ItemTemplate>
<table border="0" width="600">
<tr>
<td width="40" valign="middle">
<asp:CheckBox id="ckbSelect" runat="server"></asp:CheckBox>
</td>
<td width="2">
<asp:label class="Normal" id="lblStoreID" runat="server"
Visible="false">
<%# DataBinder.Eval(Container.DataItem, "SomeSQLTableID") %>
</asp:label>
</td>
//... other bound controls
</tr>
</table>
</ItemTemplate>
</asp:datalist>
In the behind code I check the check state and if it's selected, I get the
ID. How can I do this?
Any help would be appreciated.