ScriptTimeout

  • Thread starter Thread starter Ted Burhan
  • Start date Start date
T

Ted Burhan

Can anyone please explain to me what Server.ScriptTimeout actually is?
I don't quite understand the explanation in the documentation.

In my aspx page, I typed in the following codes:

private void Page_Load(object sender, System.EventArgs e)

{

Server.ScriptTimeout = 2;

for (int i = 0;i < 10;i++)
Thread.Sleep(1000);

}

but the request wasn't timed out. So I figure that
I must be misunderstanding something here.
Anyone please...

Ted
 
Hi!

Server.ScriptTimeout = NumSeconds

A default ScriptTimeout can be set for a Web service or Web server by using
the AspScriptTimeout metabase property. The ScriptTimeout property cannot be
set to a value less than that specified in the metabase. For example, if
NumSeconds is set to 10, and the metabase setting contains the default value
of 90 seconds, scripts will time out after 90 seconds. However, if
NumSeconds were set to 100, the scripts would time out after 100 seconds.

Thread.Sleep(1000); // Thread sleeps for 1 Sec ie. 1000 Millisec
Below is sample: Script time out( Thread Sleep for 500 Second greater the 90
Second)
private void Page_Load(object sender, System.EventArgs e)
{
Server.ScriptTimeout = 90;
for (int i = 0;i < 500;i++)
Thread.Sleep(1000);
}

Below is sample: Script time Don't time out( Thread Sleep for 50 Second less
the 90 Second)
private void Page_Load(object sender, System.EventArgs e)
{
Server.ScriptTimeout = 90;
for (int i = 0;i < 50;i++)
Thread.Sleep(1000);
}

HTH

Thanks,

sswalia
MCSD, MCAD, OCA
 
Back
Top