Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > MVC and master pages View modes: 
User avatar
Member
Member
eric.savage-clyral - 10/16/2012 3:46:43 AM
   
MVC and master pages
I am trying to implement the MVC approach for the first time using the news example in the documentation.

However, I need to use the master page for the main site, not the Root.master as in the example. How do I achieve this?

User avatar
Member
Member
ddj-datacon - 10/16/2012 4:50:15 AM
   
RE:MVC and master pages
Hi,

You can set the masterpage in the individual views through:

<%@ page MasterPageFile="~/RoutetoMasterpage"%>



User avatar
Member
Member
eric.savage-clyral - 10/16/2012 4:56:39 AM
   
RE:MVC and master pages
Excuse my ignorance, but I'm actually not sure where that lives. I can edit the master page on the root node of the site, via the CMS desk, but what file or path is that?

User avatar
Member
Member
ddj-datacon - 10/16/2012 7:24:40 AM
   
RE:MVC and master pages
Well, that masterpage is stored in the database, i don't think you can access that through the masterpagefile attribute. As far as i know that isn't possible.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/16/2012 8:51:26 AM
   
RE:MVC and master pages
Hello,


if you use Portal engine, it is not possible to mix it with MVC. It means that it is not possible to use Portal master page for MVC page. You would need to create a standard ASP.NET master page for your page and use it like ddj-datacon mentioned.


Best regards,
Helena Grulichova

User avatar
Member
Member
eric.savage-clyral - 10/16/2012 10:02:35 AM
   
RE:MVC and master pages
Ouch.