1 namespace System.Web.Mvc {
3 using System.Globalization;
5 using System.Web.Mvc.Resources;
7 public class PartialViewResult : ViewResultBase {
9 protected override ViewEngineResult FindView(ControllerContext context) {
10 ViewEngineResult result = ViewEngineCollection.FindPartialView(context, ViewName);
11 if (result.View != null) {
15 // we need to generate an exception containing all the locations we searched
16 StringBuilder locationsText = new StringBuilder();
17 foreach (string location in result.SearchedLocations) {
18 locationsText.AppendLine();
19 locationsText.Append(location);
21 throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture,
22 MvcResources.Common_PartialViewNotFound, ViewName, locationsText));