473,408 Members | 1,976 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,408 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 4126
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.