custom container controls that work at design-time?

Discussion in 'ASP .Net' started by PJ6, Sep 16, 2005.

  1. PJ6

    PJ6 Guest

    I have a simple container that I want to be able to use at design-time - as
    in, be able to drag a control into it and drop it in. I already went through
    of some problems in WinForms that this kind of functionality presents, so I
    don't exactly need it that nice - I'd be satisfied with just manually adding
    HTML in between the tags of the control. Just can't figure out how to get it
    to render what's inside its tags at the moment.

    TIA,
    Paul
     
    PJ6, Sep 16, 2005
    #1
    1. Advertising

  2. PJ6

    PJ6 Guest

    Guess I'm starting to get this hang of this.

    To create a custom web container control, inherit from HTML anchor, create a
    table, add content to the middle cell, and override the render method.

    Protected Overrides Sub Render(ByVal writer As
    System.Web.UI.HtmlTextWriter)
    CC.Controls.Clear()
    Dim cnts(Me.Controls.Count - 1) As System.Web.UI.Control
    Me.Controls.CopyTo(cnts, 0)
    For Each cnt As System.Web.UI.Control In cnts
    CC.Controls.Add(cnt)
    Next
    tbl.RenderControl(writer)
    End Sub

    For some reason I can't get the border to render at design-time, but still,
    this is more than I expected; design-time drag-drop works!

    Paul

    "PJ6" <> wrote in message
    news:...
    >I have a simple container that I want to be able to use at design-time - as
    >in, be able to drag a control into it and drop it in. I already went
    >through of some problems in WinForms that this kind of functionality
    >presents, so I don't exactly need it that nice - I'd be satisfied with just
    >manually adding HTML in between the tags of the control. Just can't figure
    >out how to get it to render what's inside its tags at the moment.
    >
    > TIA,
    > Paul
    >
     
    PJ6, Sep 16, 2005
    #2
    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. onyxring
    Replies:
    0
    Views:
    496
    onyxring
    Feb 15, 2006
  2. Mark Olbert
    Replies:
    1
    Views:
    522
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 17, 2007
  3. Robin Shaw
    Replies:
    0
    Views:
    146
    Robin Shaw
    Aug 6, 2004
  4. Replies:
    0
    Views:
    302
  5. Darren Clark

    Design Time Support for custom User Controls

    Darren Clark, Jan 13, 2006, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    192
    Darren Clark
    Feb 15, 2006
Loading...

Share This Page