Code Execution Hangs After Response.Write - Please Help!

H

Hans Kesting

Scott M. said:
You seem to be writing all classic asp in an asp.net page. Why?

Maybe he knows something we don't know yet, as he is
writing from the future :)

Hans Kesting
 
B

bruce barker

why are your transfering to another page? you have closed the connection to
the browser, so there is nowhere for a to send its output.

-- bruce (sqlwork.com)
 
M

Martin Feuersteiner

Dear Group

I'm new to http responses / requests and would be grateful if you can shed
some light on this issue.
Let's assume I've two pages, a.aspx and b.aspx. The buffer is set to false
for both.

a.aspx contains several controls, including a button control that will do a
server.transfer to b.aspx.
On b.aspx, I'm building a string (rtf document code) and send it to the
client.
I get the 'Open / Save' Dialog and the application associated with .rtf
starts, displaying the document.
Right after writing the rtf document to the client, I would like to do a
server.transfer back to a.aspx but it seems that this code never gets
executed. Code example below.

Please don't hesitate to let me know if you've any questions.
Thanks very much for your help & efforts!

Kind Regards,

Martin

Code:

a.aspx
....
Private Sub ButtonClick()
Server.Transfer("b.aspx")
End Sub

b.aspx
....
Private Sub
Dim RTFString AS String
Dim filename AS String
RTFString =
"{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0
Arial;}}_
{\*\generator Msftedit
5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 My Test Document\par_
}"
filename = "My RTF Document"

Response.ContentType = "text/richtext"
Response.AddHeader("content-disposition", "attachment; filename=""" &
filename & """")
'Write the file directly to the HTTP output stream.
Response.Write(RTFString)

Response.Clear()
Response.ClearHeaders()
Response.Close()

Response.ContentType = "text/html"

Server.Transfer("a.aspx")
End Sub
 

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

Similar Threads

Code help please 4
Help please 8
Please help 7
How do I set up IIS to debug classic ASP? 0
Help with code 0
IQR Code not working after Anaconda Upgrade 0
Need help again please 19
Please, help me. 1

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top