/// <summary>
        /// Renders the specified <see cref="MvcComponentBase" /> to the current WebForms view.
        /// </summary>
        /// <param name="helper">The HTML helper instance that this method extends.</param>
        /// <param name="component">The <see cref="MvcComponentBase" /> to render.</param>
        public static void KrystalwareWebForms(this HtmlHelper helper, MvcComponentBase component)
        {
            IComponentRenderer renderer = RendererFactory.GetRenderer(component);

            renderer.Register(component);

            using (HtmlTextWriter w = new HtmlTextWriter(helper.ViewContext.Writer))
                renderer.Render(component, w);
        }
예제 #2
0
        /// <summary>
        /// Renders the specified <see cref="MvcComponentBase" /> to the current WebForms view.
        /// </summary>
        /// <param name="helper">The HTML helper instance that this method extends.</param>
        /// <param name="component">The <see cref="MvcComponentBase" /> to render.</param>
        public static void KrystalwareWebForms(this HtmlHelper helper, MvcComponentBase component)
        {
            IComponentRenderer renderer = RendererFactory.GetRenderer(component);

            renderer.Register(component);

            using (HtmlTextWriter w = new HtmlTextWriter(helper.ViewContext.Writer))
                renderer.Render(component, w);
        }
예제 #3
0
        /// <summary>
        /// Renders the specified <see cref="MvcComponentBase" /> and returns the output for a Razor view.
        /// </summary>
        /// <param name="helper">The HTML helper instance that this method extends.</param>
        /// <param name="component">The <see cref="MvcComponentBase" /> to render.</param>
        public static MvcHtmlString KrystalwareRazor(this HtmlHelper helper, MvcComponentBase component)
        {
            IComponentRenderer renderer = RendererFactory.GetRenderer(component);

            renderer.Register(component);

            using (StringWriter s = new StringWriter())
            {
                using (HtmlTextWriter w = new HtmlTextWriter(s))
                    renderer.Render(component, w);

                return(MvcHtmlString.Create(s.ToString()));
            }
        }
        /// <summary>
        /// Renders the specified <see cref="MvcComponentBase" /> and returns the output for a Razor view.
        /// </summary>
        /// <param name="helper">The HTML helper instance that this method extends.</param>
        /// <param name="component">The <see cref="MvcComponentBase" /> to render.</param>
        public static MvcHtmlString KrystalwareRazor(this HtmlHelper helper, MvcComponentBase component)
        {
            IComponentRenderer renderer = RendererFactory.GetRenderer(component);

            renderer.Register(component);

            using (StringWriter s = new StringWriter())
            {
                using (HtmlTextWriter w = new HtmlTextWriter(s))
                    renderer.Render(component, w);

                return MvcHtmlString.Create(s.ToString());
            }
        }