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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:27:20+00:00 2026-05-28T21:27:20+00:00

I have a page with 3 users controls and I want to show one

  • 0

I have a page with 3 users controls and I want to show one user control at a time.
but I’m confused between using the user control visibility property (true,false) or by loading the user control at run time (load a control when click a button and add it to page)

I need your advice

  • 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-28T21:27:21+00:00Added an answer on May 28, 2026 at 9:27 pm

    I would suggest you to switch visibility instead of loading dynamically. That’ll make things a lot easier.

    On this way you don’t need to

    • recreate the controls on postbacks
    • store the number of created controls somewehere
    • take care of lifecycle issues(f.e. no events triggered etc) when creating controls too late
    • etc…

    Remember: Visible="False" does also mean that it will not even exist on client-side as html, so you don’t need to be afraid of creating unnecessary traffic.

    Rule of thumb: Create controls in ASP.NET dynamically only when the number of controls is unpredictable on compile time.

    But even if it’s unpredictable because you get this information from dbms you should consider to use a Data-Bound Control instead(f.e. GridView or Repeater).

    So only a few use cases remain where you need dynamical controls, for example

    • the user can add/remove controls temporarily and you don’t want to store the number in dbms but in Session or ViewState
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page (A) and a user control and I want to send
Is there a way to access page controls from user control . I have
i have 3 user control in my page . one of this user control
I have a web page that uses three controls to allow a user to
I have a page that has a bunch of user controls on it. I
I have a complex page that has several user controls like galleries, maps, ads
I use webforms/masterpage, with .NET. I Have many Web User Controls into my page.
I have added a FreeTextBox control in my page, which allows users to insert
I have a page in which I am loading a user control dynamically as
I have a drop-down list hardcoded in an MVC View User Control page 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.