asp.net-mvcasp.net-mvc-3viewrazorregion

Regions In ASP.NET Views?


I am making an ASP.NET MVC application with the razor engine.
And I was wondering if it's possible to use Regions in a view.

something like:

#region blabla
    <p>@Model.Name</p>
    <p>...</p>
#endregion

This does not work. Is there an alternative?


Solution

  • This works in Visual Studio 2015 and above (thanks to @dotnetN00b for the sample in the comments section):

    <!-- #region Test -->
    
    code here
    
    <!-- #endregion -->