Admin panel Separate layout page
How to another layout page in Asp.net/MVC
How to separate layout pages in Asp.net.MVC?
How to organized separate master pages?
How to make admin panel and client panel?
Step 1: Open your Visual studio go to Views -> Shared, right click on share folder -> Add-> MVC 5 Layout Page (Razor)
Step 2: Go to your Views ->Shared and open _Layout.cshtml pages. here in this layout pages all the html structure are there and all the bundle that you render. Copy all the code from your layout page and paste it to new layout page. After pasting the code remove all things presenting inside your body tag, and write your own code inside this body tag you want to inherit from this layout page to partial pages.
Code Screen > My Laypout page code, you have to remove highlighted code from body tag and can write your own
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″ />
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>@ViewBag.Title – My ASP.NET Application</title>
<link href=”~/Content/base.css” rel=”stylesheet” />
@Styles.Render(“~/Content/css”)
@Scripts.Render(“~/bundles/modernizr”)
</head>
<body>
<div class=”navbar navbar-expand-lg navbar-dark bg-primary fixed-top”>
<a class=”navbar-brand” href=”#”>Navbar</a>
<button class=”navbar-toggler” type=”button” data-toggle=”collapse” data-target=”#navbarColor01″ aria-controls=”navbarColor01″ aria-expanded=”false” aria-label=”Toggle navigation”>
<span class=”navbar-toggler-icon”></span>
</button>
<div class=”collapse navbar-collapse” id=”navbarColor01″>
<ul class=”navbar-nav mr-auto”>
<li class=”nav-item”>@Html.ActionLink(“Home”, “Index”, “Home”, null, new { @class = “nav-link active” })</li>
<li class=”nav-item”>
<a class=”nav-link” href=”#”>Features</a>
</li>
<li class=”nav-item”>@Html.ActionLink(“About”, “About”, “Home”, null, new { @class = “nav-link” })</li>
<li class=”nav-item”>@Html.ActionLink(“Contact”, “Contact”, “Home”, null, new { @class = “nav-link” })</li>
<form class=”form-inline my-2 my-lg-0″>
<input class=”form-control mr-sm-2″ type=”text” placeholder=”Search”>
<button class=”btn btn-secondary my-2 my-sm-0″ type=”submit”>Search</button>
</form>
@Scripts.Render(“~/bundles/jquery”)
@Scripts.Render(“~/bundles/bootstrap”)
@RenderSection(“scripts”, required: false)
</body>
</html>