Re: RenderControl throws an error

  •  01-10-2005, 1:33 PM

    Re: RenderControl throws an error

    This is the hole page, I'm not using code-behind(there is a reason why I can't use code-behind)

    <%@ Page Language="C#" %>

    <%@ Import namespace="System.Data" %>
    <%@ Import namespace="System.IO" %>
    <%@ Import namespace="CuteEditor" %>

    <%
        Editor e = new Editor();
        e.Text = "abc";

        StringBuilder sb    = new StringBuilder();
        StringWriter sw        = new StringWriter(sb);;
        HtmlTextWriter htw  = new HtmlTextWriter(sw);;

        e.RenderControl(htw);
        Response.Write(sb.ToString());
    %>

    I'm using this same code for other controls that I include on my website and they work ok, except in those instances they are UserControl not WebControls like CuteEditor. So basically I want to render the control using c# code not using (html like) tag.



View Complete Thread