PDA

View Full Version : .net repeating template control


david7777
06-23-2003, 01:32 PM
I am using templating for my site - The wilson template.
Now i need to add repeated templates into that.

For example: I have an article section, where articles are fetched from the database, then each article is put into its own formatted table, with the header, links and body...

So i need a control that can take a dataset if need be, like a datagrid, and can also be used manually...

So the manual way would look like this:

<db: box id="box1" template="article.ascx">
<header>Article 1</header>
<links>http://www.links.com</links>
<body>body stuff goes here...</body>
</db: box>
<db: box id="box2" template="article.ascx">
<header>Article 2</header>
<links>http://www.links2.com</links>
<body>2nd body stuff goes here...</body>
</db: box>

And the automatic way would look like this:

<db: box id="articles" dataset="articles_ds" header_field="title" _
links_field="links" body_field="contents" template="article.ascx" />


Any suggestions? Any articles on this sort of thing?

angiras
06-23-2003, 05:54 PM
why do you want to use an ascx file and not a placeHolder or a Panel ??
in your case it will be a ascx into a ascx !

you can create a class article with all properties for your article

then a class articleCollection : Inherits CollectionBase

which is a collection of your articles with a display mode to show them

I use that way currently

david7777
06-24-2003, 10:48 AM
Oh ok!

I see what you are saying...

Ill look into it asap.

Thanks again!