我使用的是Visual Studio 2010,但这也适用于VS 2008.
在我的MVC视图中,我更喜欢编写我的编码元素,如下所示:
<% if (somecondition) { %>
<p>something</p>
<% } else { %>
<p>something else</p>
<% } %>
Run Code Online (Sandbox Code Playgroud)
这看起来比以下更易读,这是VS自动纠正我的代码看起来像:
<% if (somecondition)
{ %>
<p>something</p>
<%}
else
{ %>
<p>something else</p>
<%} %>
Run Code Online (Sandbox Code Playgroud)
我通常会停止工作,将代码格式化为我喜欢的时尚,但我已经厌倦了.我喜欢VS中的自动纠正,但希望这只能在我的观点中停止,并且仅限于我上面描述的内容.这可能吗?