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

  • Home
  • SEARCH
  • 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 8686361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:49:43+00:00 2026-06-12T22:49:43+00:00

I am developing a dynamic website in ASP.NET. As a trial I tried a

  • 0

I am developing a dynamic website in ASP.NET. As a trial I tried a code shown below, that adds some controls to Panel1. When user clicks a button for the first time the controls are added to the Panel but when user clicks the same button for second time, the previous controls are replaced with new ones. But I want the controls to be appended one after the other each time the user clicks the button. The code is something like this:

Control c=Page.LoadControl("DData.ascx");
Panel1.Controls.Add(c);

I also tried

Control c=Page.LoadControl("DData.ascx");
Panel1.Controls.AddAt(Panel1.Controls.Count,c);

But this replaces the first output. Please tell me how to append these controls?

  • 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-12T22:49:44+00:00Added an answer on June 12, 2026 at 10:49 pm

    As you would expect, this appends a single control:

    Control c = Page.LoadControl("DData.ascx");
    Panel1.Controls.Add(c);
    

    You can append as many controls as you wish in this fashion.

    However, you need to keep track of the controls you are adding in some persisted/stateful fashion (database, Session, ViewState, etc.).

    You need to rebuild the control tree every time the page loads.

    See my answers to similar questions:

    • https://stackoverflow.com/a/10050755/453277
    • https://stackoverflow.com/a/9545079/453277
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am developing a Qt application that uses a plugin (dynamic library) and
I'm developing a search that have a dynamic number of checkboxes and a price
I have dynamic grid-based tables in the application I am developing. The following code
I am currently developing a dynamic RSS feed that will automatically pull articles from
So I'm developing something that works on dynamic variables using C# 4. And I'm
I'm developing an aplication that loads a dynamic color from a XML file. In
I'm developing a social networking website and intend to make it as dynamic as
I'm developing a dynamic website using JSP & Spring MVC 3.0 and I can't
I'm in the process of developing a website in html5, its pretty dynamic, meaning,
I am developing a web application in ASP.NET MVC and the waiting times for

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.