Basically I want a certain layout to be used when someone is visiting the root page:
www.foo.com
And another layout when visiting anywhere else:
www.foo.com/asdf
I could use different _Layout files, but since the only change is here, I find that counterproductive.
Here's what I have tried, hopefully it illustrates what I'm trying to accomplish:
@if (HttpContext.Current.Request.Url.ToString() == "some way to check root?")
{
@RenderBody()
}
else
{
<div id="big-kahuna"> <!-- Literally the only change. -->
@RenderBody()
</div>
}
if(Request.Url.PathAndQuery == "/") // root;
if (Request.AppRelativeCurrentExecutionFilePath == "~/")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With