Solved

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

Posted on 2011-03-22
8
469 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 30

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
Independent Software Vendors: 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!

 
LVL 30

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 30

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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