Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > custom container controls that work at design-time?

Reply
Thread Tools

custom container controls that work at design-time?

 
 
PJ6
Guest
Posts: n/a
 
      09-16-2005
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


 
Reply With Quote
 
 
 
 
PJ6
Guest
Posts: n/a
 
      09-16-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom container control - wrapping child controls gerry ASP .Net 5 08-06-2008 01:47 PM
custom container control - wrapping child controls gerry ASP .Net 0 07-22-2008 03:36 PM
databound custom controls vs composite databound custom controls rodchar ASP .Net 0 11-26-2007 03:51 PM
Custom Container Control Changes the Input Tag Names of Child Controls??? Chris Newby ASP .Net 1 02-25-2005 04:44 PM
Container Custom Controls A Ratcliffe ASP .Net 0 11-19-2003 07:32 PM



Advertisments