Problem with Code Folding for aspx files in visual studio 2019

Viewed 170

enter image description here

I'm having issues with code folding html elements for aspx files in vs 2019. The only way I can get it to work is to open it with another editor (open with right click menu for se).

Even if I set default to open aspx files with another editor, it still doesn't work. It seems like whatever editor i open it with first doesn't work.

Sometimes I have to switch editors multiple times to get it working.

Has anybody had this problem and/or know how to fix this? Maybe deleting some setting file somewhere?

1 Answers

This "code folding" feature is related to VS’s Outlining feature. Not sure whether you mean the Outlining doesn’t display or you want to keep the codes folding every time you open the .aspx file.

If the Outlining doesn’t display, normally, it needs some time to load, after you open the file. But if they still don’t appear after much time, you can click Edit > Outlining > Start Automatic Outlining to let it display on margin. Other related settings you can change in Tools > Options > Text Editor > C#/… > Advanced > Outlining.

If you mean you want to keep the codes folding every time you open the .aspx file, this is not possible, it is by design. Every time you open the .aspx file, the codes will be expanded as default.

Related