I am new to HTML5.
This code returns a parser error on the if statement. I do not know if it will work anyway, so how do I fix the if statement and how do I get this to work?
<div class="page">
@if (Constants.EnvironmentSetting.ToUpper() == "LIVE"){
<header>
} else {
<header class="headerTest">
}
<div id="title">
@Content.Image("MulalleyLogoSmall.jpg", "float:left;padding:10px 10px 0 10px", Url)
<div class="head" style="float:left;padding-top:4px;">Instruction To Open Contract (ITOC)</div>
</div>
<div id="logindisplay">
@Html.Partial("_LogOnUserControl")
</div>
<nav>
@Html.Partial("_MenuItems")
</nav>
</header>
<section>
@RenderBody()
</section>
</div>
You don’t need to put the curly brace on its own line.
What happens if you change it to this?
The
@:tells the Razor parser that the rest of the line should be taken as markup and not C# code.