I'm working on my first ASP.NET project and I'm torn between using asp tags (<asp:SomeElement) everywhere or use some regular HTML for simple things that need no code behind, like fixed divs, static text, etc.

I think it would be best to use ASP tags only for code behind and other dynamic stuff, whereas static elements can be in vanilla HTML, but that's assuming I won't ever need to turn them into ASP.NET in the future. Is there a best practice/recommended approach for this?

2 Answers 2


Personally I'd say use HTML controls whenever possible. It makes it much easier to compare your source to the rendered markup, which is nice when you're building CSS and javascript, or when you're troubleshooting rendering issues.

If down the road you need to convert one to a server control, it's really not that bad. In some cases you can just throw a runat="server" on it, and have access to a lot of properties from the code-behind, or you can change the tag as needed (<input> to <asp:TextBox>, etc.) in just a few seconds.

  • I'm with Joe. Use ASP controls when you must, use HTML when you can.
    – Eric King
    Aug 9, 2013 at 5:11

Microsoft first introduced server controls in an attempt to make web development seem as much like VB6 windows development as possible. It enabled developers who had very little knowledge of HTML and the web, to build web pages by dragging controls onto a design surface.

In the early days of .NET, this (arguably) made a lot of sense, but as the web has matured, and developers in general are more knowledgeable and comfortable with rolling their own HTML, the server control model seems stale, and developments like MVC come along which align more closely with the way web devs are used to working nowadays.

That said, if you are comfortable putting the HTML directly into the page, then go for it. You have more control over the page's rendering, and as Joe stated it's much easier to troubleshoot layout issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.