1 namespace System.Web.Mvc {
3 using System.Globalization;
5 using System.Web.Mvc.Resources;
7 public class ViewResult : ViewResultBase {
8 private string _masterName;
10 public string MasterName {
12 return _masterName ?? String.Empty;
19 protected override ViewEngineResult FindView(ControllerContext context) {
20 ViewEngineResult result = ViewEngineCollection.FindView(context, ViewName, MasterName);
21 if (result.View != null) {
25 // we need to generate an exception containing all the locations we searched
26 StringBuilder locationsText = new StringBuilder();
27 foreach (string location in result.SearchedLocations) {
28 locationsText.AppendLine();
29 locationsText.Append(location);
31 throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture,
32 MvcResources.Common_ViewNotFound, ViewName, locationsText));