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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:44:41+00:00 2026-05-26T03:44:41+00:00

I understand the page lifecycle and how I need to add the dynamic controls

  • 0

I understand the page lifecycle and how I need to add the dynamic controls on page_init if I want to take advantage of viewstate. And I already have read a lot of topics regarding the issue but it was not very useful.

I have to work with the solution where I have a set of user controls, that inherit one interface and then I add/delete them dynamically to a literal control. I can’t load them at once in a page_init because later I have to delete/add them based on user actions. These controls contains a button, and its post back event handler is fired only when I generate this user control at page_init or page_load methods.

So I have to somehow reinitialise/restart lifecycle of the page after needed processing in some Button_Click, (where I update the controls list) events handlers. That is not possible, as I have found. Redirecting to the same page is not a solution, because in the case I will lost my whole viewstate.

So I am stuck, could you please help me with the solution?

  • 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-26T03:44:42+00:00Added an answer on May 26, 2026 at 3:44 am

    It sounds like you could benefit from creating a CompositeControl.

    I recently answered a similar question based on dynamically creating textboxes in which I provided a fairly detailed example.

    See: Dynamically add a new text box on button click

    Hope this helps.

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

Sidebar

Related Questions

I'm stuck! I understand the page lifecycle and how i need to add the
I have been reading about the Page LifeCycle. I understand the LifeCycle, however, it's
I have done a bit of research related to dynamic controls and ViewState. And
I'm trying to understand how you are supposed to add page numbers to the
I have tried my best to understand the page translation concept shown here Offset
I'm trying to fully understand the WebForm event model (not the page lifecycle, but
I understand how to fetch a URL text page and loop over the results
I understand there is a HTTP response header directive to disable page caching: Cache-Control:no-cache
I understand that an id must be unique within an HTML/XHTML page. For a
I understand that TempData is designed to work only between a single page request.

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.