I followed this tutorial with success: http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx
All view are rendered with success when I access the page with mobile device. But, they are rendered with wrong layout (AKA masterpage).
I have the following structure: /Views/Shared/Mobile/_Layout.cshtml /Views/Shared/_Layout.cshtml
The problem is, I have to put the following statement in EVERY view:
Layout = "~/Views/Shared/Mobile/_Layout.cshtml";
Is there a place where I can place my logic to render one layout on another one?
if (normalAccess) render normal _Layout.cshtml else (mobileAccess) render /Mobile/_Layout.cshtml
I couldn't find where.
Thanks for any help.