Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 15, 2008 06:24 PM by cyberwin
Feb 12, 2008 11:00 PM|LINK
I want to create a class that is basically a collection of pre-packaged HTML elements...
For example. I have a container div - say 300x400. Inside the div, there are 2 other divs (header and body).
So, once this container div is built, I want to save it into a collection object (say, Public Class DivCluster Inherits CollectionBase)
Now, this is not difficult... I would simply make one of the fields in the class as object (I think) and save each div into the InnerList as it is created.
The problem I always face is in reading the div back. Whenever I use my collection as a datasource, all I can get out of it is text ... (System.HTML.HTMLGenericControl) or whatever it is...
I want to read all of the saved div's via Repeater.
Feb 15, 2008 06:24 PM|LINK
Well, with the help of a feller Asp.Net'er, I figured out that creating a function that takes in the control and passes back a text writer is the way to go.
Then I simply have to eval the function in the repeater!
Pretty simple... and it works great!