views:

28

answers:

1

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?

Thanks!

+4  A: 

Based on Visual Studio 2008:

[Tools -> Options]

TextEditor -> XML -> Formatting -> Auto Reformat

- On paste from clipboard
- On completion of end tag
Developer Art
Thanks, willdo for VS2010 as well. I did actually search the TextEditor Options menu, but didn't realise this should go under XML. Will check whether or not this will do the trick!!
Monty
Tested it two days, but doesn't work completely unfortunately. Still, on pasting text into <%: %>, the space gets deleted. So I'm thinking two things at the moment: or the formatting of asp.net is not working with the xml formatting options, or it's some weird bug in Visual Studio.
Monty
Try other settings for HTML, XAML and XML. I definitely got it under control myself just don't remember exactly how.
Developer Art