我可以使Visual Studio将花括号放在与if语句(HTML中)相同的行上吗?

在Visual Studio中deviseMVC视图(在.aspx或.ascx文件中)我经常使用if语句。 当我自动格式化(Ctrl-K,D)时,VS用这个非常丑陋难懂的方式来包装大括号:

<% if (Model.UserIsAuthenticated) {%> (some HTML goes here...) <% }%> 

有没有什么办法让Visual Studio自动格式像这样:

 <% if (Model.UserIsAuthenticated) { %> (some HTML goes here...) <% } %> 

还是有更好的方法来做到这一点? 我不想使用剃刀,但它看起来会解决我的问题。 如果有帮助,我使用VS2010与Resharper 5。

在“工具 – >选项 – >文本编辑器 – > C# – >格式 – >新行”是每个案例(新方法,控制块等)上的开放大括号的规则,也许你可以find你想要的。

格式化由单独的插件处理,对于js,您可以使用以下设置:

 // Defines whether an open brace is put onto a new line for functions or not. "javascript.format.placeOpenBraceOnNewLineForFunctions": true,