Enviado por George el día 14 de junio de 2006
Tengo el código este:
Response.Clear()
Response.Buffer = True
Response.Charset = \"\"
Response.ContentEncoding = System.Text.Encoding.UTF8
Response.AppendHeader(\"Content-Disposition\", \"attachment;Filename=test.xls\")
Response.ContentType = \"application/vnd.ms-excel\"
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
grdResources.RenderControl(hw)
Me.Controls.Clear()
Response.Write(tw.ToString())
Response.End()
Esto me exporta un datagrid a un excel, el problema es que cuando me sale la ventana para requerir una acción y hago click en abrir, me sale otra vez la misma ventana, y entonces cuando le doy otra vez, ya es cuando me lo abre. A ver si alguien me puede exar una mano.