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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:49:56+00:00 2026-05-11T19:49:56+00:00

I am creating a web app that will be used to create invoices and

  • 0

I am creating a web app that will be used to create invoices and quotes. Currently, I am tediously creating all the controls at design time resulting in controls like the following:

txtQty1, txtDescription1, txtUnitPrice1, txtItemCode1. Then for the next line, I just repeat the controls, but add a 2 to the end of the Id. This goes on with 3, 4, 5, etc up until however many line items I need. I know this is a stupid way of doing it and I should probably do it at runtime, but I am not sure what is the best way to do it at runtime and could I possibly use JQuery to add the ASP.NET controls at runtime?

  • 1 1 Answer
  • 1 View
  • 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-11T19:49:56+00:00Added an answer on May 11, 2026 at 7:49 pm

    It sounds like you are wanting to dynamically create some number of controls at run time and add them to the page. This is fairly common, but unfortunately is much more complicated. Everything from referencing the controls to adding events becomes just a little bit harder. Additionally, dynamically added controls must be re-added during each postback. The controls themselves do not automatically persist between postbacks.

    This article gives a great introduction to the topic: http://www.singingeels.com/Articles/Dynamically_Created_Controls_in_ASPNET.aspx

    Ultimately, it depends how easily you would like to be able to access the value of those TextBoxes. In JQuery you can create textboxes on the client side, but it will be even harder to use those values from the ASP.NET code-behind page, because they won’t be server-side controls.

    If it is just going to be a few controls, I would recommend sticking a few controls on during design time and showing and hiding them, as you are already doing. When you are dealing with more than a few, potentially many, repeated controls (which it sounds like you might be), you may have to go with dynamically added controls. Again, I tend to avoid this route unless I have to, because it adds a great deal of complexity.

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

Sidebar

Related Questions

I am creating an exercise app that will record the weight used and the
Background I have a web app that will create an image from user input.
So I am creating a web app, that will give each registered user a
I'm creating a small application that I will distribute via NuGet. My web app
I'm creating an app that needs to be accessed by both a web front
I am creating a custom membership provider for a web app that already has
I'm currently creating an MVC application that will likely to expand to include a
I am creating a test app that will work with query string values. I
I'm trying to make a web app that will continually stream audio in real
I am creating a web app that involves a lot of DB access and

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.