views:

105

answers:

2

When writing inline code in an .aspx file and some lines down closing a statement with <% } %>, Visual Studio tries to be nice but messes it up by rewriting it all. Is there any way of turning this rewriting off, but only for inline code?

+3  A: 

alt text

This setting will however have effect on all C# code, not just inline code.

Developer Art
Thank you for locating the correct option to use. Had it been possible to affect only inline or aspx files it would've been perfect.
ciscoheat
+1  A: 

An alternate approach is to use CTRL-Z to undo the auto format operation. I happen to like this better than disabling the auto format altogether since VS's style works most of the time for me. I use CTRL-Z a lot when I am trying to line things up to make the code easier to read. It might not work for you, but it is an option.

Brian Gideon
I agree that the formatting usually works so that's the way I'll go. Thanks.
ciscoheat