Hi John,
I want the closing slash, just not the closing tags. When the designer
auto-closes tags, it sometimes appends a " />" and for others it'll
append a "</my:tag>".
I just wanted to know the correct way to write a control where the form
designer knows won't accept any inner content.
Thanks,
Paul
> > Hi all,
> >
[quoted text clipped - 13 lines]
>
> John
John Saunders - 21 Sep 2006 21:30 GMT
> Hi John,
>
[quoted text clipped - 4 lines]
> I just wanted to know the correct way to write a control where the form
> designer knows won't accept any inner content.
I don't beleive this is possible with .NET 1.1. Maybe in 2.0, but I don't
know.
Will your control produce an error if there is inner content? Would inner
whitespace be ok?
John
paul.hester@gmail.com - 22 Sep 2006 22:07 GMT
The control won't throw an error - it just won't display any of the
inner content. I just wanted to emulate some of the existing server
control behaviour where it auto-closes with the "/>". I can achieve
this by deriving the control from UserControl, but I just thought
there'd be a better way of doing this.
Paul
> > Hi John,
> >
[quoted text clipped - 12 lines]
>
> John
John Saunders - 22 Sep 2006 22:29 GMT
> The control won't throw an error - it just won't display any of the
> inner content. I just wanted to emulate some of the existing server
> control behaviour where it auto-closes with the "/>". I can achieve
> this by deriving the control from UserControl, but I just thought
> there'd be a better way of doing this.
Out of curiosity, which controls auto-close like this, other than user
controls?
John
Gaurav Vaish (www.EduJiniOnline.com) - 24 Sep 2006 07:10 GMT
> I want the closing slash, just not the closing tags. When the designer
> auto-closes tags, it sometimes appends a " />" and for others it'll
> append a "</my:tag>".
For your Control, have ToolboxData attribute with appropriate values.
eg:
[ToolboxData("{0}:ControlName runat='server />"]
public class MyCustomControl : Control
{
...
}

Signature
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------