Forum Discussion
Mobile pages
Hi John,
Looks like you're calling RenderBody() on line 41 of _layoutMobile which is above where you are laying out the content of the body. I did a quick test to check this is the case with the code you provided and took the following section of code and put it just before the </body> tag:
@{
var level = "";
var pcurrent = 0;
var pcomplete = "No";
//Getting session object
if (Session["MembershipLevel"] != null)
{
level = Session["MembershipLevel"].ToString();
pcurrent = Convert.ToInt32(Session["MembershipCurrent"]);
pcomplete = Session["ProfileCompleted"].ToString();
}
//Generate variables for nav showing
var psale = false;
var mdir = false;
var pwanted = false;
var pisale = false;
var pisearch = false;
if (pcomplete == "Yes" && pcurrent == 1) //show for both basic and premium
{
psale = true;
pisale = true;
pisearch = true;
pwanted = true;
mdir = true;
}
if (IsSectionDefined("scripts"))
{
@RenderSection("scripts", required: false)
}
@RenderBody()
}
By putting the render as the last part of your mobile layout body it will always produce it below the logo and nav menu that you produce above it. You probably don't need all of the code above in that body section but hopefully this will give you enough of an idea about your issue to clean it up. Also note that if you plan on adding a footer then that would go below the section I mentioned above so the body renders between the header and footer.
I've attached a picture of how it looks with the change I described above.
Have yourself a wonderful day,
Gav