Example #1
0
        /// <summary>To HTML from user control file (ascx).</summary>
        public static string ToHtml(System.Web.UI.UserControl uc)
        {
            System.IO.StringWriter       sw     = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter writer = new System.Web.UI.HtmlTextWriter(sw);
            string contents = String.Empty;

            //try {
            uc.RenderControl(writer);
            contents = sw.ToString();
            //} catch {
            //    return "HTML Conversion Error";
            //}
            return(contents);
        }