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 8547433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:15:55+00:00 2026-06-11T13:15:55+00:00

In a CheckBoxList , how can I get the checkbox value that is set

  • 0

In a CheckBoxList, how can I get the checkbox value that is set using checkboxlist.DataValueField?

In C# the value is accessible if I call the checkboxItem.value but in HTML the value renders as value="on".

EDIT: If this is not possible, is there an attribute I can add via a data source or to each ListItem individually that is accessible through HTML? Such as the input attribute name?

  • 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-11T13:15:56+00:00Added an answer on June 11, 2026 at 1:15 pm

    DataValueField is binding of column from checkbox datasource to checkbox value. Values in HTML are from datasource column with name from DataValueField and this field is not visible in HTML. This should explain it further.

    EDIT:

    You can add attribute to ListItem. You didnt provide any example of what You have now, but You can define checkboxlist:

    <asp:CheckBoxList ID="CheckBoxList1" runat="server">
    </asp:CheckBoxList>
    

    add listitem with attribute in code behind:

    ListItem li = new ListItem("text_value", "value_value", true);
    li.Attributes.Add("id", "id_value");
    
    CheckBoxList1.Items.Add(li);
    

    This will result in generated markup like this:

    <span id="id_value">
        <input id="MainContent_CheckBoxList1_0" type="checkbox" 
            name="ctl00$MainContent$CheckBoxList1$0" value="value_value">
        <label for="MainContent_CheckBoxList1_0">text_value</label>
    </span>
    

    So You can use span id to access Your input field from jQuery:

    jQuery('#id_value input').val()
    

    You may also be interested in this article.

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

Sidebar

Related Questions

I've already tried everything i know, but still can't get my checkboxlist checked values.
How can I get any checkbox from CheckBoxList is selected via jQuery? Markup: <div>
Can we Make a checkboxList using jquery like we fill the options in select
i have a CheckBoxList with a list of services that the user can execute...
If I have a CheckBoxList within a form, like this... @using (Html.BeginForm("Save", "Product", FormMethod.Post))
I have a CheckBoxList that displays a list of checkboxes using data from a
I managed to get a checkboxlist working, and I can't somehow get the values
How can we add Checkbox item inside Listbox or there is a checkboxlist i
Is there any way that I can wrap a checkboxlist in asp.net so that
Can you please help me in storing the checkbox list items in session. I

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.