Пример #1
0
        public static IDisposable BeginZoneContent(this HtmlHelper helper,
                                                   string targetZone,
                                                   ZoneInjectMode injectMode = ZoneInjectMode.Append,
                                                   string key = null)
        {
            if (key.HasValue() && DocumentZone.HasUniqueKey(key))
            {
                return(ActionDisposable.Empty);
            }

            return(new DocumentZone((WebViewPage)helper.ViewDataContainer, targetZone, injectMode, key));
        }
Пример #2
0
        public static void RenderZone(this HtmlHelper helper, string zone)
        {
            var snippets = DocumentZone.GetZoneContent(zone);

            if (snippets == null)
            {
                return;
            }

            foreach (var snippet in snippets)
            {
                helper.ViewContext.Writer.WriteLine(snippet);
            }
        }