Ask a Question related to ASP.NET Building Controls, Design and Development.
-
paul.hester@gmail.com #1
How to write a control that doesn't require a closing tag
Hi all,
I've built a custom control that won't contain any inner content. If I
derive the control from Control, then the VS editor will always add the
closing tag when I use the control. I can derive from UserControl and
it doesn't do this, but I'm not sure whether is the best way to do
this.
What is the correct way to make a control that is self-closing (i.e.
doesn't have a closing tag)?
Thanks,
Paul
paul.hester@gmail.com Guest
-
Refresh tree control without closing? HELP
I concider myself a Flex professional but this oppertunity is beginning to consume me, please help. <mx:HTTPService id="treeModel"... -
How do I get a custom Control Designer to write to the HTML of my control?
I have created a custom 'Control Designer' that provids a popup dialog for entering more complex properties (such as property builder in the data... -
#25782 [Fbk->Opn]: require( 'require.php' ) crashing Apache 1.3.28
ID: 25782 User updated by: akinder at technology-x dot com Reported By: akinder at technology-x dot com -Status: ... -
#25782 [Opn->Fbk]: require( 'require.php' ) crashing Apache 1.3.28
ID: 25782 Updated by: sniper@php.net Reported By: akinder at technology-x dot com -Status: Open +Status: ... -
#25782 [NEW]: require( 'require.php' ) crashing Apache 1.3.28
From: akinder at technology-x dot com Operating system: Linux RedHat 9 PHP version: 5.0.0b1 (beta1) PHP Bug Type: Apache... -
John Saunders #2
Re: How to write a control that doesn't require a closing tag
<paul.hester@gmail.com> wrote in message
news:1158725719.344437.243950@k70g2000cwa.googlegr oups.com...May I ask why you want to do this? You will need the closing tag for XHTML> Hi all,
>
> I've built a custom control that won't contain any inner content. If I
> derive the control from Control, then the VS editor will always add the
> closing tag when I use the control. I can derive from UserControl and
> it doesn't do this, but I'm not sure whether is the best way to do
> this.
>
> What is the correct way to make a control that is self-closing (i.e.
> doesn't have a closing tag)?
compliance, or at least the closing slash:
<my:tag/>
John
John Saunders Guest
-
paul.hester@gmail.com #3
Re: How to write a control that doesn't require a closing tag
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
John Saunders wrote:> <paul.hester@gmail.com> wrote in message
> news:1158725719.344437.243950@k70g2000cwa.googlegr oups.com...>> > Hi all,
> >
> > I've built a custom control that won't contain any inner content. If I
> > derive the control from Control, then the VS editor will always add the
> > closing tag when I use the control. I can derive from UserControl and
> > it doesn't do this, but I'm not sure whether is the best way to do
> > this.
> >
> > What is the correct way to make a control that is self-closing (i.e.
> > doesn't have a closing tag)?
> May I ask why you want to do this? You will need the closing tag for XHTML
> compliance, or at least the closing slash:
>
> <my:tag/>
>
> Johnpaul.hester@gmail.com Guest
-
John Saunders #4
Re: How to write a control that doesn't require a closing tag
<paul.hester@gmail.com> wrote in message
news:1158868445.348947.165500@m7g2000cwm.googlegro ups.com...I don't beleive this is possible with .NET 1.1. Maybe in 2.0, but I don't> 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.
know.
Will your control produce an error if there is inner content? Would inner
whitespace be ok?
John
John Saunders Guest
-
paul.hester@gmail.com #5
Re: How to write a control that doesn't require a closing tag
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
John Saunders wrote:> <paul.hester@gmail.com> wrote in message
> news:1158868445.348947.165500@m7g2000cwm.googlegro ups.com...>> > 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.
> 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?
>
> Johnpaul.hester@gmail.com Guest
-
John Saunders #6
Re: How to write a control that doesn't require a closing tag
<paul.hester@gmail.com> wrote in message
news:1158959252.637568.50360@m7g2000cwm.googlegrou ps.com...Out of curiosity, which controls auto-close like this, other than user> 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.
controls?
John
John Saunders Guest
-
Gaurav Vaish \(www.EduJiniOnline.com\) #7
Re: How to write a control that doesn't require a closing tag
> I want the closing slash, just not the closing tags. When the designer
For your Control, have ToolboxData attribute with appropriate values.> auto-closes tags, it sometimes appends a " />" and for others it'll
> append a "</my:tag>".
eg:
[ToolboxData("{0}:ControlName runat='server />"]
public class MyCustomControl : Control
{
...
}
--
Happy Hacking,
Gaurav Vaish | [url]http://www.mastergaurav.com[/url]
[url]http://www.edujinionline.com[/url]
[url]http://articles.edujinionline.com/webservices[/url]
-------------------
Gaurav Vaish \(www.EduJiniOnline.com\) Guest



Reply With Quote

