diff --git a/src/Orchard/Mvc/ViewEngines/Razor/WebViewPage.cs b/src/Orchard/Mvc/ViewEngines/Razor/WebViewPage.cs index d372ff795..0f8245098 100644 --- a/src/Orchard/Mvc/ViewEngines/Razor/WebViewPage.cs +++ b/src/Orchard/Mvc/ViewEngines/Razor/WebViewPage.cs @@ -175,6 +175,10 @@ namespace Orchard.Mvc.ViewEngines.Razor { return new CaptureScope(this, callback); } + public IDisposable Capture(dynamic zone, string position = null) { + return new CaptureScope(this, html => zone.Add(html, position)); + } + class CaptureScope : IDisposable { readonly WebPageBase _viewPage; readonly Action _callback; diff --git a/src/Orchard/Mvc/ViewPage.cs b/src/Orchard/Mvc/ViewPage.cs index 88a876f6f..fe2b42a4b 100644 --- a/src/Orchard/Mvc/ViewPage.cs +++ b/src/Orchard/Mvc/ViewPage.cs @@ -121,6 +121,10 @@ namespace Orchard.Mvc { return new CaptureScope(Writer, callback); } + public IDisposable Capture(dynamic zone, string position = null) { + return new CaptureScope(Writer, html => zone.Add(html, position)); + } + public class CaptureScope : IDisposable { private readonly HtmlTextWriter _context; private readonly Action _callback;