Why does asp.net server controls get rendered as <span> tag?

Hello dear folks,

I am learning a lot in Javascript from this site.

I just realized that the asp server controls like <asp Label> control gets rendered out as a <span> tag.

I know <asp Label> is a server control and not a HTML control. Does all server controls get rendered onto HTML <span> tag?

can someone point me to any links/knowlegebase about this concept…totally surprised.
thanks

The reason labels get rendered inside tags is they needed some way to support the visual properties. They can actually also render as html labels if you use the right property who’s name I am not recalling. In any case, that is probably the only time one should be using label controls. Unfortunately most of the tutorials just go there and forget about the much more useful literal control which just puts your text on the page sans any wrapping element.

They can actually also render as html labels if you use the right property who’s name I am not recalling.

AssociatedControlID

You should use an <asp:Literal> if you don’t want any wrapping element.

This thread should be moved to the DotNet forum