Is it possible to modify ASP.NET to no longer require runat="server"?
Posted
by sean2078
on Stack Overflow
See other posts from Stack Overflow
or by sean2078
Published on 2010-05-05T18:06:30Z
Indexed on
2010/05/06
1:08 UTC
Read the original article
Hit count: 273
I know why runat="server" is currently required (ASP.NET why runat="server"), but the consensus is that it should not be required if you incorporate a simple default into the design (I agree of course).
Would it be possible to modify, extend, decompile and recreate, intercept or otherwise change the behavior of how ASP.NET parses ASPX and ASCX files so that runat="server" would no longer be required? For instance, I assume that a version of Mono could be branched to accomplish this goal.
In case specific requirements are helpful, the following highlights one design:
- During parsing, when configured namespace tags are encountered (such as "asp"), default the element's runat property to "server"
- During parsing, when configured namespace tags are encountered (such as "asp"), if the element's runat property value is available, then that value should be used in place of the default
- New page-level setting introduced (can be set in the page directive or web.config) that specifies the default runat value for a specific namespace tag
© Stack Overflow or respective owner