ScriptTimeout

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
 
S

SSW

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top