Ejemplo n.º 1
0
        /// <summary>
        /// Creates the framework control.
        /// </summary>
        /// <param name="context">Contains information associated with the current HTML tag.</param>
        /// <param name="output">A stateful HTML element used to generate an HTML tag.</param>
        /// <returns>The control instance.</returns>
        protected override IFWHtmlElement RenderControl(TagHelperContext context, TagHelperOutput output)
        {
            var modal = context.Items["modal"] as FWModalControl;

            context.StartInnerContent();
            modal.Footer = ChildContent.GetContent();
            context.EndInnerContent();
            return(modal);
        }
        /// <summary>
        /// Creates the framework control.
        /// </summary>
        /// <param name="context">Contains information associated with the current HTML tag.</param>
        /// <param name="output">A stateful HTML element used to generate an HTML tag.</param>
        /// <returns>The control instance.</returns>
        protected override IFWHtmlElement RenderControl(TagHelperContext context, TagHelperOutput output)
        {
            var options = context.Items["TemplateOptions"] as FWListOptions;

            if (options == null)
            {
                return(null);
            }

            context.StartInnerContent();
            var content = ChildContent.GetContent();

            context.EndInnerContent();

            if (content != null)
            {
                // TODO: Url.Action will encode { and } characters. Is there anyway to improve the performance by removing the replaces below?
                content = content.Replace("%7B", "{").Replace("%7D", "}");
                options.FluentConfiguration.Add(x => x.Template(content).ColumnClass(CssClass));
            }

            return(null);
        }