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

  • Home
  • SEARCH
  • 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 6053227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:01:00+00:00 2026-05-23T08:01:00+00:00

I am using checkboxlist in my web page as follows: <asp:CheckBoxList ID=chklstTelpas runat=server RepeatDirection=Horizontal

  • 0

I am using checkboxlist in my web page as follows:

<asp:CheckBoxList ID="chklstTelpas" runat="server" RepeatDirection="Horizontal" 
                  AutoPostBack="True" Width="594px"
                  OnSelectedIndexChanged="chklstTelpas_SelectedIndexChanged">
    <asp:ListItem Text="TELPAS Speaking" Value="1"></asp:ListItem>
    <asp:ListItem Text="TELPAS Listening" Value="2"></asp:ListItem>
    <asp:ListItem Text="TELPAS Reading" Value="3"></asp:ListItem>
    <asp:ListItem Text="TELPAS Writing" Value="4"></asp:ListItem>
</asp:CheckBoxList>

Now if I check a list item, I would like to apply some background color for that particular selected item. If i uncheck, I would like the background to remain the same color that was initially displayed, or I would like to remove the background color.

  • 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-05-23T08:01:00+00:00Added an answer on May 23, 2026 at 8:01 am

    You can do something like this

            for (int i = 0; i < chklstTelpas.Items.Count; i++)
            {
                if (chklstTelpas.Items[i].Selected)
                {
                    chklstTelpas.Items[i].Attributes.Add("style", "background-color: red;");
                }
                else
                {
                    chklstTelpas.Items[i].Attributes.Add("style", "background-color: white;");
                }
            }
    

    This will allow you to color several of the choices. If you use the SelectedIndex it wil only give you the lowest index.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this CheckBoxList on a page: <asp:checkboxlist runat=server id=Locations datasourceid=LocationsDatasource datatextfield=CountryName datavaluefield=CountryCode />
Using a <asp:SiteMapPath> control with the Web.sitemap file below: <asp:SiteMapDataSource ID=SiteMapDataSource1 runat=server /> <asp:SiteMapPath
I am using ASP.NET checkboxlist control. On the page I have a hyperlink. On
I have an <asp:CheckBoxList> using RepeatLayout=Flow in my page I dynamically assign values to.
I have one checkbox list like <asp:CheckBoxList id=CheckBoxList1 runat=server > <asp:listitem Value=1>Item 1</asp:listitem> <asp:listitem
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 am using a CheckBoxList in a VB.NET web project. The elements are pulled
I am using CheckBoxList control of Asp.Net. In order to get selected checkboxes i
I am creating a custom view in a SharePoint visual Web Part using ASP.NET
I have created a custom server control, deriving from System.Web.Contols.CheckBoxList to customize how a

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.