Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:30:58+00:00 2026-06-03T08:30:58+00:00

i have a checkboxlist control <asp:CheckBoxList ID=chkselectedItems Font-Size=12px runat=server> </asp:CheckBoxList> and i created listitems

  • 0

i have a checkboxlist control

<asp:CheckBoxList ID="chkselectedItems" Font-Size="12px" runat="server"> 
 </asp:CheckBoxList>

and i created listitems on it dynamically.If i checked more than one item from the checkbox list, How i get the selected item count using asp.net

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:31:00+00:00Added an answer on June 3, 2026 at 8:31 am

    Edit

    int numSelected = 0;
    foreach (ListItem li in chkselectedItems.Items)
    {
    if (li.Selected)
    {
    numSelected = numSelected + 1;
    }
    }
    Response.Write("Total Number Of CheckBoxes Selected:");
    Response.Write(numSelected);
    

    pre

    public string[] CheckboxListSelections(System.Web.UI.WebControls.CheckBoxList list)
    {
     ArrayList values = new ArrayList();
     for(int counter = 0; counter < list.Items.Count; counter++)
     {
      if(list.Items[counter].Selected)
      {
       values.Add(list.Items[counter].Value);
      }    
     }
     return (String[]) values.ToArray( typeof( string ) );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Web User Control that contains a CheckBoxList. MyListControl: <asp:checkboxlist id=chkList runat=server>
Greeting, if I have asp.net checkboxlist control : <asp:CheckBoxList id=list1 runat=server> <asp:ListItem>One</asp:ListItem> <asp:ListItem>Two</asp:ListItem> <asp:ListItem>Three</asp:ListItem>
I have an ASP.NET server control that inherits from CheckBoxList that renders the controls
I have created a custom server control, deriving from System.Web.Contols.CheckBoxList to customize how a
I have a list like so: <asp:CheckBoxList ID=status runat=server CssClass=smallradios RepeatDirection=Horizontal RepeatLayout=flow> <asp:ListItem Selected=true
I have one checkbox list like <asp:CheckBoxList id=CheckBoxList1 runat=server > <asp:listitem Value=1>Item 1</asp:listitem> <asp:listitem
I am using ASP.NET checkboxlist control. On the page I have a hyperlink. On
I have an ASP.Net CheckBoxList control inside an Ajax UpdatePanel. I will include the
I have this custom CheckBoxList: <CustomCheckBoxList runat=server ID=ItemsCBL DataSourceID=ItemsData DataTextField=datacolumn DataValueField=datacolumn SelectedValues='<%# Bind(Items) %>'
I have asp.net checkboxlist control that bounded to a data source so the number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.