views:

66

answers:

1

In a custom viewengine in the findview method the mastername is always empty, even if the page has a masterpage defined. Any idea why, or how can I get the mastername?

In the viewEngine class:

MasterLocationFormats = new[] {
    "~/{0}.master",
    "~/Shared/{0}.master",
    "~/Views/{1}/{0}.master",
    "~/Views/Shared/{0}.master"
};

public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) { }

In the page:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Empty.Master" Inherits="System.Web.Mvc.ViewPage" %>

The master file exists.

Thank you!

A: 

Maybe that your master page is not in standard location ? Can you post some code of your Custom viewengine ?

Thomas Jaskula