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