I can have multiple site.master files in asp.net mvc

I have several files that I want to have the same “base” layout, so I use the site.master file for this and it works fine. but now I want a different set of pages with a different "site.master" file. can i have multiple site.master files in one solution

+5
source share
4 answers

Yes. Just put the wizards in a shared folder with the Site.master file and change the link on the new View pages. You can do this by replacing the "Site.master" line on the main page or by selecting the main page of the wizard when creating new views.

+5
source

-, ( ). - -.

, 1 .

+2

Yes. You can define the main page that you want to use on top of each page, or you can install it programmatically.

+1
source

Save the name of the main page in the application settings and override the View method inside the Controller class.

 protected override ViewResult View(string viewName, string masterName, object model)   
     {

       return base.View(viewName,System.Web.Configuration.WebConfigurationManager.AppSettings["MasterPageName"], model);       
     }
0
source

All Articles