How to use ternary operator in razor (specifically on HTML attributes)?

With the WebForms view engine, I’ll commonly use the ternary operator for very simple conditionals, especially within HTML attributes. For example: <a class=”<%=User.Identity.IsAuthenticated ? “auth” : “anon” %>”>My link here</a> The above code will give the <a> tag a class of auth or anon depending on whether the user is authenticated. What is the equivalent … Read more