Thanks for getting back to me gep13. Yeah, thats what I thought. It doesn't appear to be the case though. This is the code that I am using for a Gridview Export;
Then, within the export button function;Code:Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) End Sub
Code:Dim sw As StringWriter = New StringWriter() Dim htw As HtmlTextWriter = New HtmlTextWriter(sw) Response.Clear() Response.ContentType = "application/ms-excel" 'Response.ContentType = "application/vnd.excel" Response.Charset = "" Response.AddHeader("content-disposition", "attachment;filename=" & Me.txt_SReference.Text & ".xls") 'Bind the dataset to the datagrid, to export the same to excel Me.grd_order.RenderControl(htw) 'Replace the hyperlinks Response.Write(Regex.Replace(sw.ToString(), "(<a[^>]*>)|(</a>)", " ", RegexOptions.IgnoreCase)) Response.End()




Reply With Quote