Пример #1
0
        protected override void RenderEndTag(IHtmlWriter writer, IDotvvmRequestContext context)
        {
            if (RenderWrapperTag)
            {
                base.RenderEndTag(writer, context);
            }

            if (!RenderOnServer && !RenderWrapperTag)
            {
                writer.WriteKnockoutDataBindEndComment();
            }

            if (!RenderOnServer && clientSeparator != null)
            {
                writer.AddAttribute("type", "text/html");
                writer.AddAttribute("id", GetValueRaw(Internal.UniqueIDProperty) + "_separator");
                var unique = GetValueRaw(Internal.UniqueIDProperty);
                var id     = GetValueRaw(Internal.ClientIDFragmentProperty);
                writer.RenderBeginTag("script");
                clientSeparator.Render(writer, context);
                writer.RenderEndTag();
            }

            emptyDataContainer?.Render(writer, context);
        }
Пример #2
0
 /// <summary>
 /// Renders the contents inside the control begin and end tags.
 /// </summary>
 protected override void RenderContents(IHtmlWriter writer, IDotvvmRequestContext context)
 {
     if (this.RenderOnServer)
     {
         Debug.Assert(clientSideTemplate == null);
         foreach (var child in Children.Except(new[] { emptyDataContainer, clientSeparator }))
         {
             child.Render(writer, context);
         }
     }
     else
     {
         clientSideTemplate.Render(writer, context);
     }
 }