MVC Server Side Comments with Razor

At times, it is necessary when writing code within MVC Views to create comments that you would prefer do not get sent to a browser when the page is rendered. To create a server side comment in Views when using the Razor Engine, just surround your comment with @* … comment.. *@

For example:

Hello World
@* this is a comment *@
Hello World again

categories MVC

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.