I have one datalist with one checkbox(to display categoryname) and one label(to retrieve categoryid). What I want is when I am selecting multiple checkboxes and pressing the button(get items), I have to display the corresponding categoryids of the checked checkboxes. In this code I am calling a function in onclick of button. In that subroutine I have to write a code for this. Please help me to find a solution for this, I am in a project which needs a solution for this.
Thanks
Ceema
<FORM id="Form1" runat="server"> <asp:datalist id="MyDataList" runat="server" Width="100%" Font-Size="10" GridLines="None" RepeatColumns="2" Headerstyle-HorizontalAlign="Center" Headerstyle-Font-Size="14" Headerstyle-Font-Bold="True" Headerstyle-Font-Name="Arial" Headerstyle-BackColor="#E0E0E0" Font-Name="Arial" cellspacing="2" cellpadding="2"> <ItemTemplate> <ItemTemplate> <asp:CheckBox ID="CBN1" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "CategoryName") %>'></asp:CheckBox> <asp:Label ID="lblCategoryID" Text='<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>' Visible="False"></asp:Label> <br></ItemTemplate> <br> </ItemTemplate> </asp:datalist> <asp:Label ID="label1" runat="server" /> <asp:Button id="button1" Text="Get Items" onclick="Item_Change" runat="server" /></FORM></HTML>