Solved

Can I load multiple instances of a user control at run time?

Posted on 2011-03-22
8
463 Views
Last Modified: 2012-05-11
Can I load several instances of a user control, one same control, at run time?  Thank you
0
Comment
Question by:lapucca
  • 3
  • 3
  • 2
8 Comments
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35195771
why not.... you can put your logic for that... I am not getting your question completely, Please explain.
0
 

Author Comment

by:lapucca
ID: 35195865
I think you might have answer my question.  I just want to know if I can create multiple instances of a same user control?  How would i do that?  Just use loadControl() for the number of the same user control i want?  Thanks.
0
 
LVL 29

Expert Comment

by:anarki_jimbel
ID: 35195867
Yes, more details would be helpful.

I also can't see any limitations, unless you did some tricks like "singleton" :)

User control is just a control, like any other controls (buttons, text boxes etc), and nothing should stop to create a number of same controls.

However, showing some code or giving more details would clarify the issue.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 29

Expert Comment

by:anarki_jimbel
ID: 35195877
It depends how you create one control. Yes, just repeat this code to get multiple instances.
0
 
LVL 29

Accepted Solution

by:
anarki_jimbel earned 250 total points
ID: 35195893
E.g., how you add buttons:

http://www.aspnettutorials.com/tutorials/controls/control-dym-aspnet2-csharp.aspx

But not sure how you add your controls...
0
 

Author Comment

by:lapucca
ID: 35195955
I find out at run time about how many of this user control i need to have on the page so I gess i would use LoadControl(); in a loop
0
 
LVL 13

Assisted Solution

by:Naman Goel
Naman Goel earned 250 total points
ID: 35195957
yes, that will work... that should not be problem
0
 

Author Closing Comment

by:lapucca
ID: 35196038
Thank you
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question