Esempio n. 1
0
 /// <summary>
 /// Appends markup to the virtual page file depending on the current master page.
 /// </summary>
 /// <param name="virtualPath">The master page virtual path.</param>
 /// <param name="context">The context.</param>
 /// <param name="output">The output.</param>
 /// <param name="placeHolders">The place holders.</param>
 /// <param name="directives">The directives.</param>
 protected override void BuildWithMasterPage(string virtualPath, RequestContext context, StringBuilder output, CursorCollection placeHolders, DirectiveCollection directives)
 {
     if (LayoutMvcPageResolver.IsLayoutPath(virtualPath))
     {
         var httpContext = new HttpContextWrapper(new HttpContext(HttpContext.Current.Request, HttpContext.Current.Response));
         httpContext.Items[PackageManager.CurrentPackageKey] = context.HttpContext.Items[PackageManager.CurrentPackageKey];
         SystemManager.RunWithHttpContext(httpContext, () => base.BuildWithMasterPage(virtualPath, context, output, placeHolders, directives));
     }
     else
     {
         base.BuildWithMasterPage(virtualPath, context, output, placeHolders, directives);
     }
 }
 /// <summary>
 /// Appends markup to the virtual page file depending on the current master page.
 /// </summary>
 /// <param name="virtualPath">The master page virtual path.</param>
 /// <param name="context">The context.</param>
 /// <param name="output">The output.</param>
 /// <param name="placeHolders">The place holders.</param>
 /// <param name="directives">The directives.</param>
 protected override void BuildWithMasterPage(string virtualPath, RequestContext context, StringBuilder output, CursorCollection placeHolders, DirectiveCollection directives)
 {
     if (LayoutMvcPageResolver.IsLayoutPath(virtualPath))
     {
         SystemManager.RunWithElevatedPrivilege((args) =>
         {
             HttpContext.Current.Items[PackageManager.CurrentPackageKey] = context.HttpContext.Items[PackageManager.CurrentPackageKey];
             base.BuildWithMasterPage(virtualPath, context, output, placeHolders, directives);
         });
     }
     else
     {
         base.BuildWithMasterPage(virtualPath, context, output, placeHolders, directives);
     }
 }