Function ToExcel(ByVal ctl As System.Web.UI.Control)            With HttpContext.Current.Response                .Charset = "UTF-8"
                .ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8")
                .ContentType = "Application/ms-excel"            End With
            HttpContext.Current.Response.AppendHeader("content-Disposition", "attachment;filename=" & HttpUtility.UrlEncode(Title1) & ".xls")
            ctl.Page.EnableViewState = False
            Dim tw As System.IO.StringWriter = New System.IO.StringWriter()
            tw.WriteLine(Title1)
            tw.Write(Chr(13) & Chr(10))
            tw.WriteLine(Source)
            Dim hw As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(tw)
            ctl.RenderControl(hw)            HttpContext.Current.Response.Write(tw.ToString)            HttpContext.Current.Response.End()        End Function