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.
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!
Andrew S. Erwin
Software Developer
Marked as answer by cyberwin on Feb 15, 2008 06:25 PM
cyberwin
Participant
1005 Points
296 Posts
Has anyone ever done anything like this?
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.
Any ideas?
Software Developer
cyberwin
Participant
1005 Points
296 Posts
Re: Has anyone ever done anything like this?
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!
Software Developer