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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:32:21+00:00 2026-06-01T09:32:21+00:00

I am stuck on this issue and cannot seem to find a way around

  • 0

I am stuck on this issue and cannot seem to find a way around it.
I have a CheckBoxList control. If you did not know, the FindControl() method on the CheckBoxList control returns “this”. Microsoft did it because internally they dont create many ListItem objects but just one.
Anyway, I am trying to find out if a posted back control is one of the controls in my CheckBoxList. My code looks something along the lines of:

if (!(System.Web.UI.ScriptManager.GetCurrent(Page) == null)) {
string postbackControlId =            System.Web.UI.ScriptManager.GetCurrent(Page).AsyncPostBackSourceElementID;
    if (!string.IsNullOrEmpty(postbackControlId))
    {
       Control control = ControlFinder.RecursiveFindChildControl(Controls, postbackControlId);
       if (!(control == null))
        { }
    }
}

Is there anyway to enumerate the child controls of a CheckBoxList or find if an ID that I have is equal to one of theirs?

Thanks,
Mike

  • 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-01T09:32:22+00:00Added an answer on June 1, 2026 at 9:32 am

    The UniqueID of a CheckBox within a CheckBoxList is the UniqueID of the CheckBoxList plus a $ plus the index of the item, so you can check whether postbackControlId is one of the CheckBox controls like this:

    if (postbackControlId.StartsWith(this.checkBoxList.UniqueID + "$"))
    {
        int itemIndex = Convert.ToInt32(
            postbackControlId.Substring(this.checkBoxList.UniqueID.Length + 1), 10);
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so i have been stuck with this issue for 3 weeks now and i
I've been stuck on this issue for several days - any help is much
I am stuck here and i spend last 2 days resolving this issue but
I'm stuck with this already for some weeks and I don't have the faintest
I have been stuck on this for days, and was wondering if anyone had
I have been stuck here for a good while and seem to nail the
I've been trying to get this to work. It's basically a way to have
Okay, I think I might be over-complicating this issue but I truly am stuck.
I've been trying to wrap my head around this issue: How to create a
I cannot seem to get this. Everyone else examples or questions use different functions

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.