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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:28:54+00:00 2026-05-23T18:28:54+00:00

Creating a dynamic button in code behind as: Dim b As Button = New

  • 0

Creating a dynamic button in code behind as:

Dim b As Button = New Button()
b.Text = "Some Dynamic Text Here"
b.PostBackUrl = "some_page.asx"

I want to be able to render that in a specific location on an aspx page.

In aspx page, I want to do:

<td>
<%
If (specific condition) Then
    'render that specific button here <---------
Else
    'render something else
End If 
%>
</td>

1 – I know of being able to do a

Page.Form.Controls.Add(dynamic button here)

but I can not add it into a specific place on the page (not even with CSS because the button will go into a table — the table has a column of numbers where if non zero, a button will show that crosspage postback to show drilldowned items)

  • 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-05-23T18:28:55+00:00Added an answer on May 23, 2026 at 6:28 pm

    You can put a placeholder where you want the button to be

    <asp:PlaceHolder ID="placeHolder" runat="server"></asp:PlaceHolder>
    

    And add the button in the code

    If (specific condition) Then   
        placeHolder.Controls.Add(b) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is the code how I am creating the dynamic textboxes. I want to
So I was thinking about creating a dynamic sql question, meaning that i want
I'm creating a ControlTemplate for a Button. I want to animate the size so
We are creating dynamic text boxes and buttons inside a grid for each row.
I am creating a dynamic button in a custom class, outside of the .aspx
I am creating dynamic controls, in that one control is a button. I used
I have a feeling I'm being thick, but here's my problem: I'm creating dynamic
I'm creating a dynamic expression, which will order items in a list by some
I am creating some dynamic linq and am having problems with the following exception:
I have put together this code for creating a dynamic form unit Unit1; interface

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.