473,396 Members | 1,725 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,396 software developers and data experts.

ScriptTimeout and executionTimeout do not work

I am trying to make the page execute timeout after 2 seconds.

I first tried using the Server.ScriptTimeout = 2 in the Page_Load() event.
The next line does System.Threading.Thread.Sleep(10000); // 10 second pause

I was expecting the page to timeout with a Request timeout error. However,
it did not timeout and continue to execute for the full 10 seconds.

Next, I tried to use the <httpRuntime> configuration to set the
executionTimeout attribute to 2 like this:

<httpRuntime executionTimeout="2"/>

In the Web.config file. However this did not help either.

How can I force my ASPX page to timeout after 2 seconds?

Thanks,
Arsen V.
Nov 19 '05 #1
3 9880
Hi Arsen,

Welcome to ASP.NET newsgroup.
As for the executionTimeout setting for ASP.NET's <httpRuntime>
configuration not work problem. First I should admit that the
documentation on this attribute is really not very clear. The problem is
caused by the following reasons:

1. This setting will take effect only when we set the "debug" to false in
web.config , like:

<compilation
defaultLanguage="c#"
debug="false"
/>

when set to "debug=true" mode, the runtime will ignore the timeout setting.
2. Even we set the debug="false", the executionTimeout will still has some
delay when the value is very small. In fact, it is recommeded that we don't
set the timeout less than 1.5 minutes. And when we set the timeout to less
than 1 minute, the delay will span from 5 secs up to 15 secs. For example,
if we set executionTimeout="5", it may take a bout 15 seconds for the page
to timeout.

Hope helps.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Nov 19 '05 #2
Hi Steven,

Thanks for the follow up. I will try to test by setting "debug" to "false".

Do you know why Server.ScriptTimeout does not work? Or is it also affected
by the "debug" value in the Web.config file.

Finally, if I want to have the script ALWAYS terminate after 2 seconds, what
can I do? Based on what you say, executionTimeout (and
Server.ScriptTimeout?) will not help... Is there a work around?

Thanks,
Arsen V.

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:bx**************@TK2MSFTNGXA01.phx.gbl...
Hi Arsen,

Welcome to ASP.NET newsgroup.
As for the executionTimeout setting for ASP.NET's <httpRuntime>
configuration not work problem. First I should admit that the
documentation on this attribute is really not very clear. The problem is
caused by the following reasons:

1. This setting will take effect only when we set the "debug" to false in
web.config , like:

<compilation
defaultLanguage="c#"
debug="false"
/>

when set to "debug=true" mode, the runtime will ignore the timeout setting.

2. Even we set the debug="false", the executionTimeout will still has some
delay when the value is very small. In fact, it is recommeded that we don't set the timeout less than 1.5 minutes. And when we set the timeout to less than 1 minute, the delay will span from 5 secs up to 15 secs. For example,
if we set executionTimeout="5", it may take a bout 15 seconds for the page
to timeout.

Hope helps.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 19 '05 #3
Thanks for your reply Arsen,

The reason I didn't suggest use Server.ScriptTimeout property is because
this is a COM interface which is used in classic ASP. The executionTimeout
of ASP.NET is the replacement of ScriptTimeout in asp.net , so we no longer
need to use ScriptTimeout in asp.net.

In addition, as for
==================
have the script ALWAYS terminate after 2 seconds
==================

I'm afraid there is no means in asp.net's runtime setting since the
asp.net's runtime request processing management can't reach this level of
accuracy, 2 seconds is a too small value which may make the performance
very pool to monitor such a small internval. If we do need to let a
certain processing timeout, we can consider put the timeout logic in the
above application code level. For example, if we're executing SqlCommand ,
we can set the sqlcommand 's execution timeout. Or if we are executing a
async call in page code, we can set a timeout for the async call.....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bryan | last post by:
I'm looking for a definitive answer to a Server.ScriptTimeout question. if I add <% Server.ScriptTimeout = 300 %> to a page, does that then alter the default 90 second script timeout for ALL...
0
by: g_sharad | last post by:
Hi I am trying to use the server.scriptimeout for my asp code for sending the mails to my 1000 odd subscribers But after approx 150 records the script gives an error... saying pls reset the...
2
by: Arsen V. | last post by:
I am trying to make the page execute timeout after 2 seconds. I first tried using the Server.ScriptTimeout = 2 in the Page_Load() event. The next line does System.Threading.Thread.Sleep(10000);...
6
by: Anthony Williams | last post by:
Hi all, Am I right in thinking that if I set Server.ScriptTimeout to, say, 600 that every request for an .ASPX page will wait up to 600 seconds before responding with a "Request Timed Out"...
4
by: Alphonse Giambrone | last post by:
Can executionTimeout be set at run time? I need to increase it, to allow file uploads, but would prefer to only do it when the upload page is requested. TIA -- Alphonse Giambrone Email:...
0
by: Virag Gutgutia | last post by:
Hi, I am trying to understand the behaviour of executionTimeout attribute in the httpRuntime element. From what I understood in the documentation that by setting the executionTimeout i can limit...
1
by: Chris | last post by:
I've created an aspx page that should time out every time it is executed, yet it never does. It seems as though the value of Server.ScriptTimeout is just being ignored by asp.net - I've also set...
0
by: Peter Jaffe | last post by:
I had noticed a number of people posting that they where having trouble getting the Web.config httpRuntime executionTimeout attribute to work as expected. I realized today that if the...
2
by: SevDer | last post by:
Hi We have a case where client clicks a button and series of events take place which some of them are web service calls. And sometimes, we are receiving ThreadAbortException on the final steps...
2
by: simonZ | last post by:
Page.Server.ScriptTimeout =10000 No matter If I set Server.ScriptTimeout to larger values in code behind on page_load event, page is always executed in 90 seconds.? I don't have pool setted to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.