Custom ViewEngine problem with ASP.NET MVC
In [this][1] question jfar answered with his solution the problem is it does not work for me. In the method FindView() I have to somehow check if the View we are requesting is a ViewUserControl. Because otherwise I get an error saying: 

"A master name cannot be specified when the view is a ViewUserControl."

This is my custom view engine code right now:

	public class PendingViewEngine : VirtualPathProviderViewEngine
	{
		public PendingViewEngine()
		{
			// This is where we tell MVC where to look for our files. 
			/* {0} = view name or master page name       
			 * {1} = controller name      */
			MasterLocationFormats = new[] {"~/Views/Shared/{0}.master", "~/Views/{0}.master"};
			ViewLocationFormats = new[]
			                      	{
			                      		"~/Views/{1}/{0}.aspx", "~/Views/Shared/{0}.aspx", "~/Views/Shared/{0}.ascx",
			                      		"~/Views/{1}/{0}.ascx"
			                      	};
			PartialViewLocationFormats = new[] {"~/Views/{1}/{0}.ascx", "~/Views/Shared/{0}.ascx"};
		}

		protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath)
		{
			return new WebFormView(partialPath, "");
		}

		protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath)
		{
			return new WebFormView(viewPath, masterPath);
		}

		public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
		{
			if (controllerContext.HttpContext.Request.IsAjaxRequest())
				return base.FindView(controllerContext, viewName, "Modal", useCache);

			return base.FindView(controllerContext, viewName, "Site", useCache);
		} 

	}


  [1]: http://stackoverflow.com/questions/1843894/simple-asp-net-mvc-crud-views-opening-closing-in-javascript-ui-dialog
Custom ViewEngine problem with ASP.NET MVC
===

In [this][1] question jfar answered with his solution the problem is it does not work for me. In the method FindView() I have to somehow check if the View we are requesting is a ViewUserControl. Because otherwise I get an error saying: 

"A master name cannot be specified when the view is a ViewUserControl."

This is my custom view engine code right now:

	public class PendingViewEngine : VirtualPathProviderViewEngine
	{
		public PendingViewEngine()
		{
			// This is where we tell MVC where to look for our files. 
			/* {0} = view name or master page name       
			 * {1} = controller name      */
			MasterLocationFormats = new[] {"~/Views/Shared/{0}.master", "~/Views/{0}.master"};
			ViewLocationFormats = new[]
			                      	{
			                      		"~/Views/{1}/{0}.aspx", "~/Views/Shared/{0}.aspx", "~/Views/Shared/{0}.ascx",
			                      		"~/Views/{1}/{0}.ascx"
			                      	};
			PartialViewLocationFormats = new[] {"~/Views/{1}/{0}.ascx", "~/Views/Shared/{0}.ascx"};
		}

		protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath)
		{
			return new WebFormView(partialPath, "");
		}

		protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath)
		{
			return new WebFormView(viewPath, masterPath);
		}

		public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
		{
			if (controllerContext.HttpContext.Request.IsAjaxRequest())
				return base.FindView(controllerContext, viewName, "Modal", useCache);

			return base.FindView(controllerContext, viewName, "Site", useCache);
		} 

	}


  [1]: http://stackoverflow.com/questions/1843894/simple-asp-net-mvc-crud-views-opening-closing-in-javascript-ui-dialog