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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:03:57+00:00 2026-06-09T20:03:57+00:00

This is relatively straight forward, but I’m obviously missing a step and cannot find

  • 0

This is relatively straight forward, but I’m obviously missing a step and cannot find support on resolving my issue.

I’m simply trying to append a dynamically created control to my page, but that is not happening. Here’s a stripped down version of what I’m doing:

Button button = new Button();
button.Click += new EventHandler(btnTakeAction_Click);
button.Text = "Take Action";
button.ID = "btnTakeAction";
fullPayOnlyCoupon = string.Format(
    "<div>Some random text. I want my control to show up here: {0}</div>", button);

Assume that btnTakeAction_Click is valid. Also, I know this won’t show the button properly, but instead just render it something like WebControl.Button. But that is the idea of what I’m looking for: the button to show up in a specific spot in the dynamically created markup within a string. From what I understand, you must add this button control to another pre-existing control that is already on the page. So I’ve tried this:

Button button = new Button();
button.Click += new EventHandler(btnTakeAction_Click);
button.Text = "Take Action";
button.ID = "btnTakeAction";
ControlOnAspxPage.Controls.Add(button);

But the ControlOnAspxPage does not render my dynamically created button.

  • 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-09T20:03:59+00:00Added an answer on June 9, 2026 at 8:03 pm

    Try using a Placeholder control:

    <asp:PlaceHolder
      EnableTheming="True|False"
      EnableViewState="True|False"
      ID="string"
      OnDataBinding="DataBinding event handler"
      OnDisposed="Disposed event handler"
      OnInit="Init event handler"
      OnLoad="Load event handler"
      OnPreRender="PreRender event handler"
      OnUnload="Unload event handler"
      runat="server"
      SkinID="string"
      Visible="True|False"
    />
    

    With:

    myButton = new HtmlButton();
    myButton.InnerText = "Button 2";
    PlaceHolder1.Controls.Add(myButton);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a relatively straight forward question but one that has me stumped. In
I'm relatively new to the Python world, but this seems very straight forward. Google
This is a relatively straight forward question. But I was wondering what the correct
I think this may be relatively straight forward. I have a rewrite rule that
This may be a relatively straight-forward question that I just haven't been searching for
This is probably straight forward enough but for some reason I just can't crack
I had thought that this would be a relatively straight forward mapping / persistence
This should be relatively straight forward however I'm being swamped in SQL information whenever
I am sure there must be a relatively straightforward way to do this, but
This seems like it should be relatively straightforward, I cannot figure out what I'm

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.