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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:39:06+00:00 2026-06-07T23:39:06+00:00

I am unable to find the asp:checkbox on my asp web app using the

  • 0

I am unable to find the asp:checkbox on my asp web app using the FindControl method. I put a checkbox on my form using:

<asp:CheckBox ID="test" Text="Test checkbox" runat="server" />

In my codebehind I have the following:

Control checkbox = FindControl("test");
if (checkbox != null) Debug.Print("checkbox found");
else Debug.Print("checkbox not found");

if (test.Checked) Debug.Print("checkbox is checked");
else Debug.Print("checkbox is unchecked");

however my output (with the checkbox checked) is:
checkbox not found
checkbox is checked

Can somebody please tell me what I am doing wrong?

  • 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-07T23:39:09+00:00Added an answer on June 7, 2026 at 11:39 pm

    The FindControl method is not recursive and will only find your control if you call it on the immediate parent of the checkbox. So for example, if the checkbox is placed inside an UpdatePanel that’s also inside the Page; you need to call FindControl on the UpdatePanel and not Page.FindControl as you are doing.

    The reason your output says: checkbox not found checkbox is checked is because you are calling test.checked directly, which will always work since that’s the ID you gave to your checkbox.

    Again, FindControl is not recursive and I am positive that’s why it’s failing. You can write your own “RecursiveFindControl” method but that’s almost always an overkill and inefficient as hell.

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

Sidebar

Related Questions

We are trying to create an ASP.NET web app using the apple-mobile-web-app-capable meta-tag to
By default the FormView control creates html like : ID <asp:TextBox ID=IdTextBox runat=server Text='<%#
I've created an asp.net web service and am trying to test it using my
I have been unable to find any documentation on the .build method in Rails
I keep getting ActivityNotFoundException: Unable to find explicit activity class ... when using Eclipse's
I have been unable to find anything using the google ... If I write
We are using an ASP.NET web site project with dynamic compilation, and recently moved
We have a ASP.net 2.0 web app with an installer which appears to hit
could anybody describe me how to find a control inside a ASP DetailsView using
I am posting Json data to a Restful Api. The server ASP.Net MVC app

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.