troubleshooting Question

Repeating a web user control - Please help!

Avatar of handicomp
handicomp asked on
.NET ProgrammingASP.NETEditors IDEs
8 Comments2 Solutions425 ViewsLast Modified:
Hopefully I can explain my problem clearly,

I have a fairly complex display (a scorecard) that is a web user control (containing many various type asp.net controls) on a page. It is populated by a custom data collection (an object I've named "TPD").  This works great to display one scorecard at a time. The problem is that I want to display multiple (a variable number) scorecards on a single page.

I've looked at repeater controls but my display (the scorecard) does not fit the conventional iterative controls (list control, datagrid etc) and I don't think that route would work for me anyway.

I have done similar in the past without using a web user control as follows:

- Loop through the data and each time through the loop append a string with standard html (no web user control, no asp.net controls) representing a scorecard.

- Assign the completed string to the text property of a literal control which renders it to the screen.



Another solution (that I find basically unworkable but might explain what I am trying to do!) is as follows:

- Put 50 (or some large number) instances of the web user control on the page and hidden.

- Then loop through the data and create x number of data objects (the "TPD's" I mentioned earlier)

- Populate and make visible as many of the web user controls as necessary.

This seems messy and inefficient to me! Am I missing something completely obvious here?

Any guidance would be appreciated.

Thanks in advanced!

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros