I promise I am complete newbie to MVC Core (I have only 1 week practice) I know how to add a master page to a Dot net framework but not to MVC Core. Can anyone help me? Thanks
            Asked
            
        
        
            Active
            
        
            Viewed 4,653 times
        
    2
            
            
        - 
                    3It's called Layout page in MVC. Search this term and you'll find some more information. – Yan May 21 '18 at 10:02
- 
                    2this link will help you: https://stackoverflow.com/questions/5161380/how-do-i-specify-different-layouts-in-the-asp-net-mvc-3-razor-viewstart-file – Hasan Gholamali May 21 '18 at 10:09
2 Answers
6
            Layout Page Structure (Layout1.cshtml)
<!DOCTYPE html>  
<html>  
<head>  
    <meta name="viewport" content="width=device-width" />  
    <title>@ViewBag.Title</title>  
@RenderSection("head", false)  
</head>  
<body>  
     @Html.ActionLink("Home", "Index", "My") |   
     @Html.ActionLink("AboutUs", "AboutUs", "My") |   
     @Html.ActionLink("ContactUS", "ContactUS", "My") |   
     @Html.ActionLink("Facebook", "Facebook", "My") |   
     @Html.ActionLink("Twitter", "Twitter", "My")  
    <br />  
        @RenderBody()  
    <br />  
    Hello Nitin Pandit…………This is the demo of Layout pages.  
</body>  
</html> 
Set the Layout Page of your view when creating of your action method view
@{
  Layout = "~/Shared/_Layout1.cshtml";
}
 
    
    
        Mr. Roshan
        
- 1,777
- 13
- 33
 
     
    