7
有谁知道如何到Visual Studio配置ViewASP.NET MVC视图代码格式化 - 括号<% } %>
内正确地格式化代码段这惹恼了废话失控我!:
<select>
<%
foreach(Height height in ViewData.Model.Heights)
{%>
<option value="<%=height.ID %>"><%=height.Value%></option>
<%
}%>
</select>
它应该是这样的:
<% foreach(Height height in ViewData.Model.Heights) { %>
<option value="<%=height.ID %>"><%=height.Value%></option>
<% } %>
</select>
我可以手动修复它,但每当我重新格式化,或再次关闭改变一些代码,以括号它搞砸了!
重复:http://stackoverflow.com/questions/720042/how-do-you-get-server-blocks-to-format-well-in-visual-studio – 2009-11-25 13:48:43
错过我也...期待一个答案。 – Mayo 2009-11-25 13:48:56
删除了MVC标签,这也是使用webforms的情况。 – jfar 2009-11-25 14:50:16