Re: prevent runat="server"
- From: mnichols <mnicholscwi_nospam@xxxxxxxx>
- Date: Sat, 03 Jun 2006 12:37:13 -0400
Hello,
I don't think there is any way that you can easily get away from including the runat="server" attribute value pair since it is exactly what the server uses to identify sever side nodes.
The asp:ListItem can probably get away without it since it is a child of an asp:DropDownList tag that already has a runat="server attribute/value pair. (This would suggest that you could use a <body runat="server ....> tag to trigger server side preprocessing to add the runat tags where necessary but it would probably be challenging.)
If you are using XHTML then you probably use xslt preprocessing (with or without the <body runat="server ....> attribute). Again that would lead to challenges because for some tags, i.e. <input>, it is optional to have runat="server" though your practices may allow you to be 100% certain of where you want or don't want runat="server" to appear.
If server-side preprocessing is a realistic option then regular expressions may be a path to consider instead of xslt.
HTH,
mnichols
Willy Van den Driessche wrote:
Thanks for the answer. I have investigated how the ASP:ListItem accomplishes this but I have been without luck..
As for the visibility, using <myPrefix: should be enough to make it stand out of the ordinary HTML markup (but that of course is gustibus et coloribus).
"Nathan Sokalski" <njsokalski@xxxxxxxxxxx> schreef in bericht news:OSuqCbrhGHA.4284@xxxxxxxxxxxxxxxxxxxxxxxI believe there is (if you look at the ASP:ListItem control you will notice that you don't need to specify runat="server" for that). However, I would not recommend going to the effort of using it unless it is a control that is used ONLY between the opening/closing tags of one of your other controls. This is my recommendation because seeing the runat="server" helps distinguish the server controls from the HTML controls, so it is probably not worth the trouble and possible risk of extra errors unless the control will be used a HUGE number of times on the same page.
--
Nathan Sokalski
njsokalski@xxxxxxxxxxx
http://www.nathansokalski.com/
"Willy Van den Driessche" <willy.van.den.driessche@gmailDOOTcom> wrote in message news:OISdG3qhGHA.3496@xxxxxxxxxxxxxxxxxxxxxxxI have a set of webcontrols that will only run on the server. Is there a way I can specify this in my code, so that the designer using my controls (he is not using visual studio but Adobe Golive on Mac) doesn't have to specify this for each custom control tag ?
So instead of
<abc:myControl runat="server" />
he can just write
<abc:myControl/>
thanks in advance
- Follow-Ups:
- Re: prevent runat="server"
- From: Willy Van den Driessche
- Re: prevent runat="server"
- References:
- prevent runat="server"
- From: Willy Van den Driessche
- Re: prevent runat="server"
- From: Nathan Sokalski
- Re: prevent runat="server"
- From: Willy Van den Driessche
- prevent runat="server"
- Prev by Date: Re: What do validation controls do, internally, on server side to stop to page processing from continuing?
- Next by Date: Re: how to retrieve data from websites
- Previous by thread: Re: prevent runat="server"
- Next by thread: Re: prevent runat="server"
- Index(es):
Relevant Pages
|