what are things that make bad output of HTML?
I know that in ASP.NET web forms developers can't control the output HTML. But does this happen with every thing in ASP.NET web forms? or is there secific controls that开发者_JS百科 we can't control the HTML of them?
Cheers.
The simplest rule of thumb is: the more the server control does for you, the more output markup there is going to be which you don't have control over.
The simplest is surely an asp:Literal
- there's nothing in that beyond your control. An asp:Label
is just a <span>
. But once you work your way up to controls like asp:GridView
, now you're talking some serious quantities of HTML and JavaScript being generated.
Any of the server controls will generate their own output. These would include anything that has the runat = "server"
attribute. You have some control over the output, but it's declarative rather than imperative. Meaning you can tell the control what you'd like it to do, but not how to go about doing it.
精彩评论