From db2e53d086c44595a0da5c160d064cc9529d032e Mon Sep 17 00:00:00 2001 From: loudej Date: Wed, 16 Dec 2009 21:58:15 +0000 Subject: [PATCH] Adding html helper for rendering zone with callback for content --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044182 --- src/Orchard/Mvc/Html/LayoutExtensions.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Orchard/Mvc/Html/LayoutExtensions.cs b/src/Orchard/Mvc/Html/LayoutExtensions.cs index 11ec88776..ea54fe578 100644 --- a/src/Orchard/Mvc/Html/LayoutExtensions.cs +++ b/src/Orchard/Mvc/Html/LayoutExtensions.cs @@ -1,4 +1,5 @@ -using System.Web.Mvc; +using System; +using System.Web.Mvc; using Orchard.Mvc.ViewEngines; using Orchard.Mvc.ViewModels; using Orchard.UI.Zones; @@ -32,7 +33,12 @@ namespace Orchard.Mvc.Html { } public static void Zone(this HtmlHelper html, string zoneName) where TModel : BaseViewModel { - Zone(html, zoneName, null); + Zone(html, zoneName, string.Empty); + } + + public static void Zone(this HtmlHelper html, string zoneName, Action action) where TModel : BaseViewModel { + html.ViewData.Model.Zones.AddAction(zoneName, x => action()); + Zone(html, zoneName, string.Empty); } public static void RenderZone(this HtmlHelper html, string zoneName, string foo) { }