Repeater control in a rendered custom control

Discussion in 'ASP .Net Building Controls' started by Cappy, Jan 21, 2004.

  1. Cappy

    Cappy Guest

    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
     
    Cappy, Jan 21, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SSBhbSBTYW0=?=

    Custom control and Rendered HTML Tag

    =?Utf-8?B?SSBhbSBTYW0=?=, Jun 1, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    =?Utf-8?B?SSBhbSBTYW0=?=
    Jun 1, 2005
  2. Leeor Chernov
    Replies:
    2
    Views:
    793
    Leeor Chernov
    Oct 16, 2005
  3. Matt Sokol
    Replies:
    2
    Views:
    390
    Theo Tillotson
    Aug 7, 2003
  4. Rob Joosen

    Keep custom property-value in custom rendered control

    Rob Joosen, May 12, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    144
    Rob Joosen
    May 12, 2004
  5. bobben

    Image rendered from a custom control

    bobben, Feb 4, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    105
    bobben
    Feb 6, 2004
Loading...

Share This Page