Just like you would in regular Razor:
@if (price>30)
{
<p>The price is too high.</p>
}
EDIT
For updated question, I guess you want this:
<div class="@((string.IsNullOrEmpty(ErrorMessage)? "hide-errors" : ""))">
Just like you would in regular Razor:
@if (price>30)
{
<p>The price is too high.</p>
}
EDIT
For updated question, I guess you want this:
<div class="@((string.IsNullOrEmpty(ErrorMessage)? "hide-errors" : ""))">