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

The Archive Base Latest Questions

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

I have two user controls, in one of them I have a textbox, i

  • 0

I have two user controls, in one of them I have a textbox, i need to retrieve its value from the second user control which is registered in the same page. How can i do this? I know the following line is wrong.. but i recall it was something like that.

TextBox myText = (TextBox)FindControl["mycontrol"] as TextBox;
  • 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:08:58+00:00Added an answer on June 1, 2026 at 9:08 am

    If you need to access the value of the second control from the first control

    var textBox = this.Page.FindControl("SecondUserControl")
                      .FindControl("tbCardNumber") as TextBox;
    

    Where SecondUserControl is the id given in the page and tbCardNumber is the id given for the TextBox in the second control

    If you try to access the TextBox from a page

    var textBox = SecondUserControl1.FindControl("SecondUserControl")
                                    .FindControl("tbCardNumber") as TextBox;
    

    Where SecondUserControl1 is the ID of the control and you can access it in code behind.

    However, you can expose the the value of the text box via a property

    public string TextBoxValue
    {
       get
        {
            return tbCardNumber.Text;
        }
    }
    

    But you would still need FindControl method if you access it via another user control

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

Sidebar

Related Questions

i have two text boxes which the user should enter one of them i
I have two User Controls already created now I want to use one as
I have a user control in my wp7 application which contains two text boxes
i have two user controls , both of them in the same master page
I have an application based on two user controls and one form. This form
I have two user controls (ascx); one contains some forms, and the other one
I have a user control in a master page with two drop down lists.
I have two tables user and email. One user can have multiple emails so
I have two panorama pages. The first one contains letters, the second one contains
I have a user control that has a grid (the one you get automatically

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.