473,503 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code Execution Hangs After Response.Write - Please Help!

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{\fonttb l{\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

Nov 18 '05 #1
4 2211
You seem to be writing all classic asp in an asp.net page. Why?
"Martin Feuersteiner" <th************@hotmail.com> wrote in message
news:uh*************@TK2MSFTNGP11.phx.gbl...
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{\fonttb l{\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

Nov 18 '05 #2

"Scott M." <s-***@nospam.nospam> wrote in message news:ef**************@TK2MSFTNGP09.phx.gbl...
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
Nov 18 '05 #3
"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:eZ*************@TK2MSFTNGP10.phx.gbl...
Maybe he knows something we don't know yet, as he is
writing from the future :-)


We'll all be using DOS by the end of the year... :-)
Nov 18 '05 #4
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)
"Martin Feuersteiner" <th************@hotmail.com> wrote in message
news:uh*************@TK2MSFTNGP11.phx.gbl...
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{\fonttb l{\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

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1693
by: Brett | last post by:
rf=Request.ServerVariables("HTTP_REFERER") sv2=Request.ServerVariables("URL") & "?" & Request.ServerVariables("QUERY_STRING") if instr(rf,"http://www.westcoast") = 1 then 'response.redirect...
1
2075
by: SABmore | last post by:
I have the following code that populates 3 independent drop-down boxes with data from arrays. From there the user can select a value from a drop-down list, or input data into a text box. The user...
1
7749
by: AckMike | last post by:
I am trying to write client and server programs that communicate with named pipes. There is one multithreaded server that handles all of the requests and multiple multithread clients that make...
15
11727
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
2
1720
by: | last post by:
I have a breakpoint in an aspx page that I'm using to try to trap some code to see what's going on. I'm translating a page that is working in a traditional ASP page, which takes several session...
2
2059
by: Dave | last post by:
Hello, I am trying to write an application that will talk to an SMTP server using sockets. I can connect to the server just fine, then I can receive the first message from the server. I can then...
9
4894
by: Rea | last post by:
Hi eb I set some 'Stop' statements and also visual breakpoints in asp code (vbscript). I am doing that in Microsoft Script debugger. Than I refresh the original page and expect execution to halt...
3
1421
by: solomon_13000 | last post by:
The problem with the code bellow is that suppose I change the valid database name from stelladb.mdb to an invalid database name stella.mdb, what happens is the following statement gets executed: ...
5
1257
by: hemdagem | last post by:
<% 2. option explicit 3. ' 4. set fs=CreateObject("Scripting.FileSystemObject") 5. set tfile=fs.CreateTextFile("c:\somefile.txt") 6. test = "Hello World!" 6. tfile.WriteLine(test) 7. ' 8....
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.