473,224 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Response.Write Strange Behaviour

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
9 4121
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
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
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
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
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
"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
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
> 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
:)

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
3
by: Sebastian C. | last post by:
Hello everybody Since I upgraded my Office XP Professional to SP3 I got strange behaviour. Pieces of code which works for 3 years now are suddenly stop to work properly. I have Office XP...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
1
by: Dan | last post by:
Hi I've created a generic 'Report' class that takes a DataView from a DataGrid control and writes it out to the response as a csv file for download. Basically, when a user clicks the download...
1
by: csgraham74 | last post by:
Hi there, ive written a function to display some returned values in a table. I use response.write to write the values as html. My problem is that this has stopped working correctly and i find...
5
by: Tim_Mac | last post by:
hi, i read that by adding the following code to by aspx pages, it would not store temporary internet files: Response.Cache.SetCacheability(HttpCacheability.NoCache); it didn't actually work...
13
by: TSB | last post by:
Hi everyone, I think algorithm is very important for every computer language. But I don't know another important things. I am newbie to computer languages, so anyone can tell me what the most...
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.