Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 481
  • Last Modified:

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

Can I load several instances of a user control, one same control, at run time?  Thank you
0
lapucca
Asked:
lapucca
  • 3
  • 3
  • 2
2 Solutions
 
Naman GoelSoftware engineer 1Commented:
why not.... you can put your logic for that... I am not getting your question completely, Please explain.
0
 
lapuccaAuthor Commented:
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
 
anarki_jimbelCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
anarki_jimbelCommented:
It depends how you create one control. Yes, just repeat this code to get multiple instances.
0
 
anarki_jimbelCommented:
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
 
lapuccaAuthor Commented:
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
 
Naman GoelSoftware engineer 1Commented:
yes, that will work... that should not be problem
0
 
lapuccaAuthor Commented:
Thank you
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now