How to put a if
condition inside a <body>
tag?
When trying to do:
@if (Request.Path.Substring(Request.Path.LastIndexOf("/") + 1).ToLower() == "default") {
<body class="home"
} else {
<body>
}
It does not run because it does not have a </body>
tag together. If it were a <p></p>
clause it would work, but since the closing tag </body>
can not be together it does not let it execute.
When trying to make one:
<body @if (Request.Path.Substring(Request.Path.LastIndexOf("/") + 1).ToLower() == "default") { Response.Write("class='home'"); } >
It also does not even come close to wanting to work.