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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:19:06+00:00 2026-05-10T15:19:06+00:00

I have several user controls, let’s say A , B , C and D

  • 0

I have several user controls, let’s say A, B, C and D. Based on some random input, I need to generate a combination of these. For e.g. if input is 2a3d1a2c I need to show two of the A’s, 3 D’s after that, an A again, etc.

I will also need to stabilize clientid’s in order for them to work correctly. Because each of these controls use their own ClientID property to gather the inputs on themselves. For e.g. user control A internally generates an input named this.ClientID + '$input1', and gathers its input from request like Request[this.ClientID + '$input1']. Since there can be more than one A, each A needs to have the same (unique) ClientID after postback in order to get correct inputs from request.

  • 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. 2026-05-10T15:19:07+00:00Added an answer on May 10, 2026 at 3:19 pm

    To add controls dynamically, you can use a panel as a place holder, say

    <asp:Panel ID='ControlPlaceholder' runat='server' /> 

    Then, on the server side, you can add objects to it like so:

    int controlCount = 0;  ...  TextBox newTextBox = TextBox(); newTextBox.ID = 'ctl_' + controlCount++; ControlPlaceholder.Controls.Add(newTextBox); 

    If you add the controls to it during your Page_Load event and use a consistent method of generating the controls’ IDs (such as a the simple count above) then any viewstate or event bindings will be re-bound to the right object on a postback.

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

Sidebar

Related Questions

I have several user drawn controls on a form, unfortunately when the form is
I have several similar user controls which display listviews of respectively different data entities.
I have a complex page that has several user controls like galleries, maps, ads
Hi I have a view with several User Controls and I pass ViewData to
I have a web user control that contains several other (web user) controls and
I have several winforms listbox controls I am hosting in a user control. The
I have a user control that is pretty basic. It contains several TextBox controls,
I have several different user controls that get built dynamically and added to a
I have a page with several user controls that use Ajax. When I try
I have a silverlight class library (not a top-level application) with several user controls

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.