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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:52:55+00:00 2026-06-10T19:52:55+00:00

I am working a project for my company. There I have encountered a problem.

  • 0

I am working a project for my company. There I have encountered a problem. Therefore, I am showing an example of what I intended to do and what I am not being able to do.

In my aspx page I have button and placeholder. e.g.

 <asp:Button ID = "brnClickme" runat = "server" Text = "Click Me"onclick="brnClickme_Click" />
  <asp:PlaceHolder ID = "PH" runat = "server"></asp:PlaceHolder>

and in my aspc.cs file I have a dynamic control, say a Label that will changed its value after the Button is clicked

so I have written the code like this

    protected void Page_Init(object sender, EventArgs e)
    {
        Label label = new Label();
        label.Text = "I am in the Place holder";
        PH.Controls.Add(label);
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }


   protected void brnClickme_Click(object sender, EventArgs e)
    {
        Label label = (Label)FindControl("label");
        label.Text = "After Click I am changed!";
    }

But in the Button click event, I am not finding the Label, so I am not being able to change the text of this dynamically created label with a click. I know I have made a mistake, so Please tell me what Mistake Have I made and What am I suppose to do.

Thanks in advance

  • 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-10T19:52:56+00:00Added an answer on June 10, 2026 at 7:52 pm

    Try finding the control in the placeholder

    PH.FindControl("label"); 
    

    You probably want to give the label an ID to make it easier to find when you create it.

    label.ID = "findme";
    

    then

    PH.FindControl("findme"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I working on project and have problem with threading and update of UI. I
I'm working on an intranet django project (not using GAE) for a company that
I have a project that I'm working on and I need to be able
i'm working on a project at a company for school and I have to
I'm working on a project for my company that uses a socket server (php)
Good afternoon, I'm working on a project for my company to run an update
I'm working on a fairly large project for a trading company in Philadelphia. The
I have a working project that Im amending, it crashes after trying to use
I have a working C2DM project, atm. I have me and my colleagues phones
I have a project working fine under MSVS 2010 SP1. I'm trying to convert

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.