Or, should I ask when the VS formatting for Razor markup will work correctly? Formatting works for most structures, but seems to block the if blocks. The code is below, as it is formatted by VS. It is very easy to fix this case with one more indentation, but I accepted formatting well in everyday use and wanted to use it often for most of my code, so I would prefer to avoid manual formatting if possible. Right now I'm just leaving it as VS formats it.
@{ if (User.Identity.IsAuthenticated) { <text>Hello </text> @Html.Display("@ViewBag.UserName") <text> - </text> @Html.ActionLink("Sign Out", "LogOff", "Account", null, new { style = "font-weight: bold;" }) } }
I think this is important for readability, for example, in the above, the body of the if block has indentation, except that you look better.
visual-studio asp.net-mvc visual-studio-2010 asp.net-mvc-3 razor
ProfK Aug 01 2018-11-18T00: 00Z
source share