Re: prevent runat="server"



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@xxxxxxxxxxxxxxxxxxxxxxx
I 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@xxxxxxxxxxxxxxxxxxxxxxx
I 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




.



Relevant Pages

  • Re: Help with HTML control
    ... Even if you specify in the code what the size ... Make sure this tag is within the tab. ... > click a button to move a file from my local computer to a server. ... > page_init code fires just fine if the file selected for copy is 3 MB ...
    (microsoft.public.dotnet.framework.aspnet)
  • Problems with disabling ASP.NET controls using javascript
    ... javascript so the user can't do anything with any of the controls on ... using javascript, it gets grayed out, but the user can still use it. ... on the server side by setting the control's Enabled property to false, ... there is no href in the tag. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: prevent runat="server"
    ... server uses to identify sever side nodes. ... challenges because for some tags, i.e., it is optional to have ... runat="server" helps distinguish the server controls from the HTML ... a way I can specify this in my code, so that the designer using my ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Server Error in / Application.
    ... I ma using ASP server controls. ... This tag should then have its "mode" attribute ... The current error page you are seeing can be replaced by a custom ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help with HTML control
    ... If you specify it in the code what the file size ... you have to put this tag in the web.config file. ... > click a button to move a file from my local computer to a server. ... > page_init code fires just fine if the file selected for copy is 3 MB ...
    (microsoft.public.dotnet.framework.aspnet)