c# – Automatic deletion of spaces on asp.net tags – Education Career Blog

Little question out of annoyment with Visual Studio 2010. Whenever I write lines like this:

<%: Html.LabelFor(model => model.AccountName) %>

And save the file, some lines (some, not all of them, haven’t figured out the logic behind this yet) will be converted to this:

<%: Html.LabelFor(model => model.AccountName)%>

Quite subtle difference, but I was wondering which magic happens here. Anyone got an idea? And perhaps an idea how to switch this magic off?



Based on Visual Studio 2008:

Tools -> Options

TextEditor -> XML -> Formatting -> Auto Reformat

- On paste from clipboard
- On completion of end tag

Leave a Comment