Changing the Content-Type "invalids" the page.

M

mvargasp

Hi all,

I have a web form which contains a frame, (a form
containing a menu on the left and a web form containing a
datagrid on the right). Also there is a button (right
side) which transforms the datagrid content in a CSV file
and forces the user to download the file. The following is
the code used to force a download:

'strCadena contains the datagrid info separated by commas,
as a CSV file
Response.ContentType = "application/octet-stream"
Response.AddHeader("content-
disposition", "attachment;filename=Reporte_InfoRed.csv")
Response.Write(strCadena)
Response.End()

After the user saves the file, the links on the menu on
the left side don't work and the buttons on the right side
promt an error on the client side. I think it's because of
the change of the Content-Type. When I click on a menu
link and then view the history of the browser, the "name"
for the last page visited is "No page to display".

Does anybody know if there is any other way to force a
download without changing the Content_Type?

Thanks in advance.

God Bless.
 
Y

Yan-Hong Huang[MSFT]

Hello,

I am looking for somebody who could help you on it. Thanks very much.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "mvargasp" <[email protected]>
!Sender: "mvargasp" <[email protected]>
!Subject: Changing the Content-Type "invalids" the page.
!Date: Thu, 17 Jul 2003 09:19:11 -0700
!Lines: 30
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcNMfyg2/8gh8xWQSeSXwRLwOo8PKQ==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.public.dotnet.general
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:101543
!NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
!X-Tomcat-NG: microsoft.public.dotnet.general
!
!Hi all,
!
!I have a web form which contains a frame, (a form
!containing a menu on the left and a web form containing a
!datagrid on the right). Also there is a button (right
!side) which transforms the datagrid content in a CSV file
!and forces the user to download the file. The following is
!the code used to force a download:
!
!'strCadena contains the datagrid info separated by commas,
!as a CSV file
!Response.ContentType = "application/octet-stream"
!Response.AddHeader("content-
!disposition", "attachment;filename=Reporte_InfoRed.csv")
!Response.Write(strCadena)
!Response.End()
!
!After the user saves the file, the links on the menu on
!the left side don't work and the buttons on the right side
!promt an error on the client side. I think it's because of
!the change of the Content-Type. When I click on a menu
!link and then view the history of the browser, the "name"
!for the last page visited is "No page to display".
!
!Does anybody know if there is any other way to force a
!download without changing the Content_Type?
!
!Thanks in advance.
!
!God Bless.
!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top