Growing with the Web

Use razor comments in MVC views not HTML comments

Published
Tags:

Make sure for code documentation you use the razor-style comments in your ASP.NET MVC views, not HTML-style comments. Regular HTML comments will be sent to the client which would increase the page size and expose unnecessary implementation details to the end-user, razor comments are kept server-side.

Good

@* Comment *@

Bad

<!-- Comment -->

Comments

comments powered by Disqus
Like this article?
Subscribe for more!