Visual Studio - Improving Code Bending

Are there any options (third-party or others) for improving code folding in the Source Editor for HTML / ASP.Net ?

The #region directive makes it easy to create your own partitions, but it does not work in the source editor. Ideally, I would like to flush larger areas of code than between blocks of code on the server side. But below is what happens ...

<% // Search Results Section            <-- Just want folding here

   foreach (int item in list) { %>  <-- but it is here also
       Number : <% =item %>
   <% }        

   //etc...
%>

Code bending falls between <% and%>, which is actually not the way I want. I am trying to get sections of code.

+3
source share
2 answers

, ASP.Net Markup. VS 2008 Pro ( ) " " ( ) .

+3

, . - :

//some code
#region "my foreach loop"
foreach(int item in list)
{
//so dome work
}
#endregion
//some more code

, , ,

//some code
#region "foreach(int item in list)"
foreach(int item in list)
{
//so dome work
}
#endregion
//some more code

, .aspx, , . , , , . , .

0

Source: https://habr.com/ru/post/1711021/


All Articles