diff --git a/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs b/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs
index f2bcbf800d..0c200f95f8 100644
--- a/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs
+++ b/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs
@@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.Razor
/// The name of the page.
/// Determines if the page being found is a partial.
/// The of locating the page.
- /// Page search semantics match .
+ /// .
RazorPageResult FindPage(ActionContext context, string pageName, bool isPartial);
///
@@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Mvc.Razor
/// The path to the page.
/// Determines if the page being found is a partial.
/// The of locating the page.
- /// See also .
+ /// .
RazorPageResult GetPage(string executingFilePath, string pagePath, bool isPartial);
///
@@ -43,6 +43,6 @@ namespace Microsoft.AspNet.Mvc.Razor
/// is a relative path. The value (unchanged)
/// otherwise.
///
- string MakePathAbsolute(string executingFilePath, string pagePath);
+ string GetAbsolutePath(string executingFilePath, string pagePath);
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs
index 3923e0ea2f..c1f461e8a1 100644
--- a/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs
+++ b/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs
@@ -174,7 +174,7 @@ namespace Microsoft.AspNet.Mvc.Razor
// Pass correct absolute path to next layout or the entry page if this view start set Layout to a
// relative path.
- layout = _viewEngine.MakePathAbsolute(viewStart.Path, viewStart.Layout);
+ layout = _viewEngine.GetAbsolutePath(viewStart.Path, viewStart.Layout);
}
}
finally
diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs
index 11cea4997e..c3613ee667 100644
--- a/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs
+++ b/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs
@@ -276,7 +276,7 @@ namespace Microsoft.AspNet.Mvc.Razor
private ViewLocationCacheResult LocatePageFromPath(string executingFilePath, string pagePath, bool isPartial)
{
- var applicationRelativePath = MakePathAbsolute(executingFilePath, pagePath);
+ var applicationRelativePath = GetAbsolutePath(executingFilePath, pagePath);
var cacheKey = new ViewLocationCacheKey(applicationRelativePath, isPartial);
ViewLocationCacheResult cacheResult;
if (!ViewLookupCache.TryGetValue(cacheKey, out cacheResult))
@@ -350,7 +350,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}
///
- public string MakePathAbsolute(string executingFilePath, string pagePath)
+ public string GetAbsolutePath(string executingFilePath, string pagePath)
{
if (string.IsNullOrEmpty(pagePath))
{
@@ -505,11 +505,14 @@ namespace Microsoft.AspNet.Mvc.Razor
}
var page = result.ViewEntry.PageFactory();
+ page.IsPartial = isPartial;
+
var viewStarts = new IRazorPage[result.ViewStartEntries.Count];
for (var i = 0; i < viewStarts.Length; i++)
{
var viewStartItem = result.ViewStartEntries[i];
viewStarts[i] = viewStartItem.PageFactory();
+ viewStarts[i].IsPartial = true;
}
var view = new RazorView(
diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/HtmlHelperPartialExtensions.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/HtmlHelperPartialExtensions.cs
index a53893bd34..340ea3dc75 100644
--- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/HtmlHelperPartialExtensions.cs
+++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/HtmlHelperPartialExtensions.cs
@@ -68,7 +68,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
throw new ArgumentNullException(nameof(partialViewName));
}
- return htmlHelper.PartialAsync(partialViewName, htmlHelper.ViewData.Model, viewData: viewData);
+ return htmlHelper.PartialAsync(partialViewName, htmlHelper.ViewData.Model, viewData);
}
///
@@ -259,8 +259,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
throw new ArgumentNullException(nameof(partialViewName));
}
- return htmlHelper.RenderPartialAsync(partialViewName, htmlHelper.ViewData.Model,
- viewData: htmlHelper.ViewData);
+ return htmlHelper.RenderPartialAsync(partialViewName, htmlHelper.ViewData.Model, viewData: null);
}
///
@@ -290,7 +289,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
throw new ArgumentNullException(nameof(partialViewName));
}
- return htmlHelper.RenderPartialAsync(partialViewName, htmlHelper.ViewData.Model, viewData: viewData);
+ return htmlHelper.RenderPartialAsync(partialViewName, htmlHelper.ViewData.Model, viewData);
}
///
@@ -320,7 +319,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
throw new ArgumentNullException(nameof(partialViewName));
}
- return htmlHelper.RenderPartialAsync(partialViewName, model, htmlHelper.ViewData);
+ return htmlHelper.RenderPartialAsync(partialViewName, model, viewData: null);
}
}
}
diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/ViewContext.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/ViewContext.cs
index ec3569eed4..a1f16306d8 100644
--- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/ViewContext.cs
+++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/ViewContext.cs
@@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
///
public class ViewContext : ActionContext
{
- // We need a default FormContext if the user uses html