Click here to Skip to main content
16,017,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Following is my code

XML
<osm:SlideMenu ID="SlideMenu1" SelectedId="true" runat="server"
        AllExpanded="True">
    <MenuItems>
    <osm:Parent>Category</osm:Parent>
    <osm:Child>
        <asp:CheckBoxList ID="cblCategory" runat="server">
        </asp:CheckBoxList>

        <asp:Button ID="btnCategory" runat="server" Text="Submit"
        onclick="btnCategory_Click" />
    </osm:Child>
    </MenuItems>
    </osm:SlideMenu>



Category

Boys Top Wear
Sarees-Checkbox
Shirts-checkbox
Sweaters & Sweatshirts-checkbox
T Shirts-checkbox

Now my problem is that when check in any checkbox and click on button it display checked category so how can i do it
Posted

1 solution

protected void btnCategory_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
   for (int i = 0; i < cblCategory.Items.Count; i++)
   {
      if (cblCategory.Items[i].Selected)
      {
          Response.Write("SelectedCategory:" +  cblCategory.Items[i].Text );
      }
   }
}


and if it doesnot works then try using 'findcontrol'
 
Share this answer
 
v2
Comments
[no name] 23-Mar-13 5:27am    
I want to know Where you want to display selected checkbox item, on listbox or on messagebox or textbox or where??
Member 9815058 28-Mar-13 6:25am    
in datalist

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