i have a number of files that i want to have the same "base" layout so i am using the site.master file for this and its working perfectly. but now i want another set of pages with a different "site.master" file. can i have multiple site.master files in one solution
You can nest as many master pages as you would like.
Yes you can use multiple master page but at a time one master page should be referenced. You can inherits multiple master page at code behind by specifying the master page in the pre_Init event of page life cycle.
If you want a Master Page, you can add the page (Web Forms Master Page) from Add+New item (Ctrl+Shift+A). Now, you can add two Master Pages in your Project Solution Explorer. Here, we can add some webform, like Home page,Technology page and extra. Here, open the default .
In ASP.NET, you can have multiple master pages each for a different purpose. You can provide users several layout options using Multiple Master Page. You can define Master Page at multiple places in the web application.
Yes. Just put the masters in the Shared folder along with the Site.master file and change the reference in the new View pages. You can do this by replacing the "Site.master" string for the Master Page or selecting the master page from the wizard when creating new views.
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