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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:18:59+00:00 2026-06-01T23:18:59+00:00

A custom control inside my Masterpage , Does that can access the main page?

  • 0

A custom control inside my Masterpage, Does that can access the main page?

Please help!
This is my code.

namespace TVSSystem
{
    public partial class ControlTVS1 : System.Web.UI.UserControl
    {
        Page abc;
        protected void Page_Load(object sender, EventArgs e)
        {
            abc = this.Page; //Control: I suposse that I can access all controls of my page
        }


        protected void Image1_Click(object sender, ImageClickEventArgs e)
        {
        ContentPlaceHolder cph = (ContentPlaceHolder)abc.FindControl("ContentPlacerHolder1");

       TextBox txt = (TextBox)cph.FindControl("TextBox1");
       Button btn = (Button)cph.FindControl("Button3");
       txt.Visible = true;
       btn.Visible = true;
        }
    }
}

Solved.
http://forums.asp.net/t/1000865.aspx/1

  • 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-01T23:19:01+00:00Added an answer on June 1, 2026 at 11:19 pm

    You could use the Page property to access the page containing this user control (no matter if you placed it inside a masterpage):

    public partial class WebUserControl1 : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var page = this.Page;
            ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a custom compound control that extends RelativeLayout. Inside this component, there is
I have a custom control that own a property. Inside this custom control OnInit
Hopefully some Custom Control Designers/Builders can help I'm attempting to build my first custom
I have a custom control in an aspx page that has a property named
I have a custom control that I've placed inside a cell of a grid.
I have a listbox inside a custom control. I use this custom control into
I have a custom control an inside of it I have a textbox that
I'm working on custom control that I can use for interactions within my app
I'm creating custom control that contain multiple parts. Inside template creation I'm subscribing for
In XPages we can define a custom error page that shows whenever a runtime

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.