Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-22
8
Medium Priority
?
479 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 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 1000 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

963 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