Author: jerrykur | Posted on: 9/1/2009 3:39:56 PM | Views : 290

Hi,
I have a bit of code that exports the contents of a gridview to a text file.  It works fine when I run it from my main form, but I want to connect it to a popup modal or a separate page that lets the user enter some parameters.  When I do this the files is exported, but  popup modal or separate page does not close. The code is :
HttpContext.Current.Response.Clear() HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileName)) HttpContext.Current.Response.ContentType = "application/text" Dim FileContentString As New StringBuilder ' Write Rows For Each dr As DataRow In dt.Rows ........... Next HttpContext.Current.Response.Write(FileContentString.ToString) HttpContext.Current.Response.End()
I suspect this because the Response.E ...

Go to the complete details ...