I have a _ViewStart.cshtml in my main view folder with the following code.
@{ Layout = "~/Views/Shared/_Layout.cshtml"; } In the View folder of my admin area I have a _ViewStart.cshtml with this code
@{ Layout = Request.IsAjaxRequest() ? null : "~/Areas/Admin/Views/Shared/_Layout.cshtml"; } I put a breakpoint on both lines of code, and when I go into the admin area I can see it hits the viewstart in that folder and not the one in the main folder. Even though it hits that code it still only uses the main layout.
Request.IsAjaxRequest()null? I'm also a bit confused by your terminology. What's a 'main view folder'? Do you mean not in an area?