Solved

How do I trap for a script timeout error ASP0113.

Posted on 2001-06-22
5
702 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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