In visual studio 2010 markup in MVC3 and ASPX pages was collapsible (by closing tag) however it does not seem to be working in visual studio 2012. Anyone know how to get it working? I cant find it in the options...
:-)
To collapse an outlining region, double-click any line in the region on the outlining margin, which appears just to the left of the code. You can see the contents of a collapsed region as a tooltip when you hover over the collapsed region.
Expand / Close All Where you see braces or regions in code, you can collapse or expand them with the keyboard shortcut Ctrl + M, P to expand or Ctrl + M, O to collapse.
Select some piece of code and use (ctrl+r, ctrl+e), type your region name and press enter. Or select some piece of code, press F1 and type "Move into #region". To remove a single #region, click the line that contains '#region' keyword and use (ctrl+r, ctrl+e).
Seems to work in Visual Studio 2012
@* <!-- #region Some Name --> *@
@* <!-- #endregion --> *@
This looks like it has already been answered here: Collapse C# block within cshtml and save it However, if you're after automatic collapsing of Razor sections in your cshtml, then it looks like you're out of luck. The usual CTRL-M,M and CTRL-M+CTRL-T chorded shortcuts will work only on the html which you will see have the familiar +/- collapsing indicators on the margin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With