Solved

How do I trap for a script timeout error ASP0113.

Posted on 2001-06-22
5
703 Views
Last Modified: 2012-06-21
Does anyone know how to trap for script timeout errors, so that if it happens I can present a user friendly message instead of the message

"The maximum amount of time for a script to execute was exceeded. You can change the limit by specifying a new value for the property Server.ScriptTimeOut or by changing the value in the IIS administration tools."

Please note that I have already increased the timeout value . I am looking for a generic way for testing for script timeout rather than a way to improve performance.
0
Comment
Question by:davejcole
  • 3
5 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6217658
AFAIK there is no way...
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6217673
this error is thrown by the asp.dll i think..
0
 
LVL 10

Expert Comment

by:makerp
ID: 6217693
no way, the script will time out and end, there is no way to trap that, worse still no way to inform the browser as i assume the connection will go when the script ends.
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6217744
you can try to fetch the content of the page from another asp page .. this is a turn around to do it..

How do I read the contents of a remote web page?    
You can include static txt and HTML files from remote servers by using a component (such as AspHTTP (http://www.serverobjects.com/products.htm), ASPTear (http://www.alphasierrapapa.com/ComponentCenter/AspTear/), or VB's built in InetCtrls) to parse the remote URL's content.
 
You can also try this method out, it uses the MSXML objects which are installed with Windows 2000 (or you can download them here (http://download.microsoft.com/download/xml/Install/3.0/WIN98Me/EN-US/msxml3.exe) for other operating systems):
 
<%
    url = "http://www.espn.com/
    set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
    xmlhttp.open "GET", url, false
    xmlhttp.send "" 
    Response.write xmlhttp.responseText
%>


the last method is recommended.. you simply check for the timeout error.. if it didn't timeout then display the content, otherwise redirect to your default error template

0
 
LVL 20

Accepted Solution

by:
Silvers5 earned 75 total points
ID: 6217754
<%
   url = "yourtarget.asp"
   set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
   xmlhttp.open "GET", url, false
   xmlhttp.send "" 
   if instr(xmlhttp.responseText,"Timed out ..etc fetch an exact  sentence from the timout page") then
set xmlhttp = nothing
response.redirect "scripttimedout.asp"
else
Response.write xmlhttp.responseText
set xmlhttp = nothing
end if
%>


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question