Repeater control in a rendered custom control

C

Cappy

I have created a custom control that puts a html wrapper around some
code

so <myc:cPanel ...>more html</myc:cPanel> will draw a html table which
contains the code between the tags.


basicaly all I did was override the render method and appended html to
the top and bottom of the existing output like so

protected override void Render(HtmlTextWriter output)
{
RenderParentTableTop(output);
base.RenderContents(output);
RenderParentTableBottom(output);
}

No from this I want to derive another control that will encapsulate a
repeater control in the same html wrapper. So what I would have on
screen would be a html panel with a databound repeater as its content
and simply takes a datasource as property.

Any ideas how I would go about doing this? I would I be able to fix
the template within my control?

or would it be better to just drive my class from the repeater control
and as before append the html wrapper to the output.

What I am trying to do is build up a suite of web controls that draw
portal type panels with specific content. So a panel with a tree
control for menu, another one with a repeater in it showing news
articles, and other one with no content specified.. another one for
ads,i.e single image and a button etc

I have done the basic one which I have mentoined above.. which allows
me to put any content in the panel and also the Add one.

I could just do this

<myc:cPanel ...>
<asp:Repeater...>
<itemtemplate>
</itemtemplate>
</asp:Repeater>
</myc:cPanel ...>

every time I want to add the panel.. but what I want to be able to do
is
<myc:cPanel DataSource=newsDataSet ...></myc:cPanel ...> and get the
same result.

Thanks
Amit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top