By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,212 Members | 2,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,212 IT Pros & Developers. It's quick & easy.

Response.Write Strange Behaviour

P: n/a
Hi,

I have an asp page that does a lot of processing and reports it's
finished by printing the word "Success". For example:

<% SomeFunction(SomeVar)

SomeFunction(SomeVar1)

SomeFunction(SomeVar3)

Response.Write("Success")

%>

For one of our clients the word "Success" no longer appears. The page
is stuck loading. I have checked the log files created by the
processing function and they all complete their tasks successfully.
Even stranger still if I add some debugging code to the function:-

<% Function SomeFunction (SomeVar)

For i = 0 to ABigNumber

...Do some stuff...

Response.Write ("Some debug text")
Response.Flush

Next
End Function %>

This will print out all the debugging text and the wanted word
"Success". I tab the two Response lines out and the page never loads.
Put then back in and the page prints all the text and loads fine.

It seems that if you don't keep the response object busy it will stop
working after a few minutes. I have tried Response.End, Response.Flush
even Response.WriteBlock and still nothing.

I am trying to find a way to print out the word "Success" with all the
debug text. Any ideas?

Dominic Godin
Jul 19 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Opps Should be:-

I am trying to find a way to print out the word "Success" WITHOUT all the
debug text. Any ideas?
Makes all the difference :)

Dominic Godin

Jul 19 '05 #2

P: n/a
Well, as soon as you response.Flush your response, that text will be out.
You can comment out the response.flush lines and then do a Response.Clear
just before you do your Response.WRite "success".

Ray at work

"Dominic Godin" <nospam@plz> wrote in message
news:Xn***********************@207.46.248.16...
Opps Should be:-

I am trying to find a way to print out the word "Success" WITHOUT all the
debug text. Any ideas?
Makes all the difference :)

Dominic Godin

Jul 19 '05 #3

P: n/a
Maybe this will help?
http://www.aspfaq.com/2498

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Dominic Godin" <nospam@plz> wrote in message
news:Xn***********************@207.46.248.16...
Hi,

I have an asp page that does a lot of processing and reports it's
finished by printing the word "Success". For example:

<% SomeFunction(SomeVar)

SomeFunction(SomeVar1)

SomeFunction(SomeVar3)

Response.Write("Success")

%>

For one of our clients the word "Success" no longer appears. The page
is stuck loading. I have checked the log files created by the
processing function and they all complete their tasks successfully.
Even stranger still if I add some debugging code to the function:-

<% Function SomeFunction (SomeVar)

For i = 0 to ABigNumber

...Do some stuff...

Response.Write ("Some debug text")
Response.Flush

Next
End Function %>

This will print out all the debugging text and the wanted word
"Success". I tab the two Response lines out and the page never loads.
Put then back in and the page prints all the text and loads fine.

It seems that if you don't keep the response object busy it will stop
working after a few minutes. I have tried Response.End, Response.Flush
even Response.WriteBlock and still nothing.

I am trying to find a way to print out the word "Success" with all the
debug text. Any ideas?

Dominic Godin

Jul 19 '05 #4

P: n/a
Dominic Godin wrote:
Hi,

I have an asp page that does a lot of processing and reports it's
finished by printing the word "Success". For example:

<% SomeFunction(SomeVar)

SomeFunction(SomeVar1)

SomeFunction(SomeVar3)

Response.Write("Success")

%>

For one of our clients the word "Success" no longer appears. The page
is stuck loading. I have checked the log files created by the
processing function and they all complete their tasks successfully.
Even stranger still if I add some debugging code to the function:-

<% Function SomeFunction (SomeVar)

For i = 0 to ABigNumber

...Do some stuff...

Response.Write ("Some debug text")
Response.Flush

Next
End Function %>

This will print out all the debugging text and the wanted word
"Success". I tab the two Response lines out and the page never loads.
Put then back in and the page prints all the text and loads fine.

It seems that if you don't keep the response object busy it will stop
working after a few minutes. I have tried Response.End, Response.Flush
even Response.WriteBlock and still nothing.

I am trying to find a way to print out the word "Success" with all the
debug text. Any ideas?

Dominic Godin


First off, do a "View Source" in the browser and _ensure_ that the
"Success" isn't present in the HTML page's source; incorrect HTML can
render it not visible.

Long-running pages can timeout: see the Server.ScriptTimeout property,
http://msdn.microsoft.com/library/de...m_seropsct.asp
which is set in seconds. Default value is 90 seconds IIRC but cannot be
set to less than the value in IIS configuration(metabase).

Also look at the Response.IsClientConnected property. There's a good
post on it by Manohar Kamath at
http://www.google.com/groups?hl=en&l...6safe%3Dimages

Still more posts at
http://www.google.com/groups?as_q=&n...04&safe=images

and some WWW documentation at
http://www.google.com/search?q=+%22r...oring=r&tab=gw

Good Luck,
Michael D. Kersey
Jul 19 '05 #5

P: n/a
Hi,

Unfortunately this doesn't work.

Originally the asp page ended with:
Response.Write "Success"
%>

Which still works for most of our clients.

For the long proccessing time case I have tried:

Response.Clear
Response.Write "Success"
Response.Flush
%>

<%
Response.End
%>
and many combinations of the above.
I have also tried:
<% SomeFunction(SomeVar)
Response.Write("Test1") %>

<% Response.Flush %>

<% SomeFunction(SomeVar1)
Response.Write("Test2") %>

<% Response.Flush %>

<% SomeFunction(SomeVar3)

......

Response.Write("Success")

%>

With the two Response lines commented out it still loads forever. I know
the functions have run due to the changes they make to our log files. It's
just the Response.Write that doesn't do anything.
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
news:Op**************@TK2MSFTNGP11.phx.gbl:
Well, as soon as you response.Flush your response, that text will be
out. You can comment out the response.flush lines and then do a
Response.Clear just before you do your Response.WRite "success".

Ray at work

"Dominic Godin" <nospam@plz> wrote in message
news:Xn***********************@207.46.248.16...
Opps Should be:-

I am trying to find a way to print out the word "Success" WITHOUT all
the debug text. Any ideas?
Makes all the difference :)

Dominic Godin



Jul 19 '05 #6

P: n/a
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in news:#
4m*************@TK2MSFTNGP12.phx.gbl:

Maybe this will help?
http://www.aspfaq.com/2498


Thanks but it doesn't. I've chopped up the code with asp delimiters but it
made no difference.

Dominic Godin
Jul 19 '05 #7

P: n/a
First off, do a "View Source" in the browser and _ensure_ that the
"Success" isn't present in the HTML page's source; incorrect HTML can
render it not visible.
Checked and it isn't :(.

Long-running pages can timeout: see the Server.ScriptTimeout property,
http://msdn.microsoft.com/library/de...l=/library/en- us/iissdk /iis/ref_vbom_seropsct.asp which is set in seconds. Default value is
90 seconds IIRC but cannot be set to less than the value in IIS
configuration(metabase).
I have set this to 30 minutes. The script only takes 10 so this is not
it :(.


Also look at the Response.IsClientConnected property. There's a good
post on it by Manohar Kamath at
http://www.google.com/groups?hl=en&l...UTF-8&threadm= 35002A69.4C56D0 74%40niu.edu&rnum=3&prev=/groups%3Fas_q%3D%26num%3D10%26as_scoring% 3Dr% 26hl%3Den%26ie%3DUTF-8%26btnG%3DGoogle%2BSearch%26as_epq% 3Dresponse.isc lientconnected%26as_oq%3D%26as_eq%3D%26as_ugroup%3 D%26as_usubject%3D% 26 as_uauthors%3D%26as_umsgid%3D%26lr%3D%26as_drrb%3D q%26as_qdr%3D% 26as_mi nd%3D12%26as_minm%3D5%26as_miny%3D1981%26as_maxd%3 D25%26as_maxm%3D5% 26a s_maxy%3D2004%26safe%3Dimages

Still more posts at
http://www.google.com/groups?as_q=&n...hl=en&ie=UTF-8 &b tnG=Google+Search&as_epq=response.isclientconnecte d&as_oq=&as_eq=&as_u g roup=&as_usubject=&as_uauthors=&as_umsgid=&lr=&as_ drrb=q&as_qdr=&as_mi n d=12&as_minm=5&as_miny=1981&as_maxd=25&as_maxm=5&a s_maxy=2004 &safe=imag es

and some WWW documentation at
http://www.google.com/search?q=+%22r...ntconnected%22 &hl=en& lr=&ie=UTF-8&sa=N&scoring=r&tab=gw
I tried adding

'Check to see if the client is connected.
If Not Response.IsClientConnected Then
'Get the sessionid to send to the shutdown function.
Shutdownid = Session.SessionID
'Perform shutdown processing.
Shutdown(Shutdownid)
End If

This doesn't work. I'm sure this just stops it running server side.

Good Luck,
Michael D. Kersey


Jul 19 '05 #8

P: n/a
> I have set this to 30 minutes. The script only takes 10 so this is not
it :(.


???

You have an ASP script that takes 10 minutes? Have you considered a
different approach? This is not a realistic time frame for a web page,
IMHO. An end user is not going to wait for it. If it's a task for admins
only, there are probably a dozen other approaches, depending on what exactly
you are trying to accomplish.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #9

P: n/a
:)

OK let me explain.

We have a software product that our clients use. They have the option
to upload certain data to an online database for display on the web.
The application to upload this data originally connected directly to the
online database at the clients ISP. We gave up this approach as many
ISPs seemed unable or unwilling to let us connect through their
firewalls.

The new approach was to ftp the data in delimited text files to the ISP
and run a asp script to import them from behind the firewall. This is
this script I'm having trouble with. It imports the data and displays
"Success" which the application uses to check if the import was
successful. We have been using this for over a year now without any
trouble.

I didn't write or design this but I have the unfortunate task of
maintaining it. One of our clients uploads a lot of data and this is
the one causing me problems.

As I'm running out of time to fix this I have used a botch.

I now Response.Write( "&nbsp;" ) in the importing function loop to keep
the Response working.

The application then just trims the output.

Not pretty but it's a solution and I'm just about out of time. I wish I
could do this properly but I just don't know how.

Dominic Godin

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in
news:e6**************@TK2MSFTNGP11.phx.gbl:
I have set this to 30 minutes. The script only takes 10 so this is
not it :(.


???

You have an ASP script that takes 10 minutes? Have you considered a
different approach? This is not a realistic time frame for a web
page, IMHO. An end user is not going to wait for it. If it's a task
for admins only, there are probably a dozen other approaches,
depending on what exactly you are trying to accomplish.


Jul 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.