Why do ASP.Net server management declarations require the runat = "server" attribute?

Surely the fact that they are declared starting with "<asp:" is enough to conclude that they are server controls? Or it is simply included for completeness (so that they look similar to a server management declaration, for example, "input server" =). Or is there some special reason?

It always seems to me that the compiler tells me that I skipped this when I do this by accident. Kind of thinking like "var" - if the compiler knows what it is .. why bother with me saying this?

+5
source share
1 answer

Taken from this forum topic :

Internet Explorer supports DHTML behavior.

[Asp: control syntax] does not mean server control. You can create a DHTML client that has a namespace and will run on the client machine. Also, namespaces are allowed in XHTML and technically you can use asp namespace for something else on the client if you wish. Runat = "server" prevents namespace conflict. If the element does not have runat = "server", it will be sent to the client browser unchanged. Therefore, you can use HTML components (HTC) on ASP.NET pages.

Look at here

http://msdn.microsoft.com/workshop/author/behaviors/howto/creating.asp http://msdn.microsoft.com/workshop/author/behaviors/overview.asp

, , runat =.

+8

All Articles