Solved

How do I trap for a script timeout error ASP0113.

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now