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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:27:30+00:00 2026-05-13T01:27:30+00:00

I would like to add an ASP:label and ASP:textbox control to a page through

  • 0

I would like to add an ASP:label and ASP:textbox control to a page through Javascript.

<asp:Label ID="lblone" runat="server"></asp:Label>

if i want to write this syntax or want to add this label on page using innerHTML then want can be the way….

I want to add it on button click event… and the ID should be appended by 1 and the next time 1+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-05-13T01:27:31+00:00Added an answer on May 13, 2026 at 1:27 am

    Does it need to be an ASP .NET control or could it just be normal HTML?

    If you want an ASP .NET control these, by design, are rendered on the server so there would either need to add the controls by using one of the following approaches:

    1) Synchronous PostBack (normal postback)
    2) Async PostBack (javascript postback which doesn’t refresh the page visually but still does a postback)
    3) Traditional AJAX

    You’ve probably already tried the Sync PostBack since you’re mentioning that you want to do this in Javascript. So that leaves Async PostBack or traditional AJAX.

    The Async PostBack is the easiest because you just need to wrap everything in an UpdatePanel

    <asp:UpdatePanel id="Updater" runat="server">
        <asp:PlaceHolder id="AddControlsToThis" runat="server" />
        <asp:Button id="Submit" runat="server" />
    </asp:UpdatePanel>
    

    Treat this like a normal postback and in the codebehind add whatever control you want to the placeholder on button click.

    The third approach (adding via AJAX) is a little too much to describe here but basically you would use AJAX to make a request to a web service that you would set up on the server and then you would need to “render” the control on the server (each control has a RenderControl function…you would need to use this to get the resulting HTML) and use the resulting HTML to send back as a response of the web server…sorry if that’s a little vague. Like I said the traditional AJAX approach requires more description than I can get into here.

    Good luck.

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

Sidebar

Related Questions

Using ASP.Net, I have a server control for which i would like to add
If in the markup you declare a control like this: <asp:Label runat=server AssociatedControlID=txtSomeInput>Some Input:</asp:Label>
I would like to setup a admin page (ASP.NET/C#) that can add IIS host
I would like to add a default value for an asp textbox that looks
I would like to add a Facebook like button to my asp.net page. I
i have added to my page an asp.net calendar control and i would like
I would like to add graphing to my User Controls in ASP.NET MVC. I
I would like to add OpenId support to an app. It runs on ASP.NET
I have an existing ASP.NET website which I would like to painlessly add CMS
I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as

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.