ASP.NET Server.ScriptTimeout being ignored

G

Guest

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 executionTimeout in Machine.Config and Web.Config to = "3", which is also being ignored. I've tried rebooting, iisreseting, begging, and pleading. Can someone please tell me what I'm doing wrong

WebForm1.aspx.c

using System
using System.Collections
using System.ComponentModel
using System.Data
using System.Drawing
using System.Web
using System.Web.SessionState
using System.Web.UI
using System.Web.UI.WebControls
using System.Web.UI.HtmlControls

namespace MyWebAp

/// <summary
/// Summary description for WebForm1
/// </summary
public class WebForm1 : System.Web.UI.Pag

private void Page_Load(object sender, System.EventArgs e

//Set timeout to three second
Server.ScriptTimeout = 3
//Sleep for five second
System.Threading.Thread.Sleep(new TimeSpan(0,0,0,5,0))
//Why does it make it this far!


#region Web Form Designer generated cod
override protected void OnInit(EventArgs e

/
// CODEGEN: This call is required by the ASP.NET Web Form Designer
/
InitializeComponent()
base.OnInit(e)


/// <summary
/// Required method for Designer support - do not modif
/// the contents of this method with the code editor
/// </summary
private void InitializeComponent(
{
this.Load += new System.EventHandler(this.Page_Load)

#endregio




WebForm1.asp
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="MyWebApp.WebForm1" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta name="GENERATOR" Content="Microsoft Visual Studio 7.0"><meta name="CODE_LANGUAGE" Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body MS_POSITIONING="GridLayout"><form id="Form1" method="post" runat="server"
"Hello, I'm Jello.
</form></body></HTML>
 
C

Cowboy \(Gregory A. Beamer\)

What gives away that it is not expiring? The fact that the page still sits
on the client? If so, that is normal. To explicitly change the page,you will
have to use client script, as there is not a connection to the server after
the page is Requested.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
Chris said:
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 executionTimeout in
Machine.Config and Web.Config to = "3", which is also being ignored. I've
tried rebooting, iisreseting, begging, and pleading. Can someone please tell
me what I'm doing wrong?
WebForm1.aspx.cs

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace MyWebApp
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
//Set timeout to three seconds
Server.ScriptTimeout = 3;
//Sleep for five seconds
System.Threading.Thread.Sleep(new TimeSpan(0,0,0,5,0));
//Why does it make it this far!?
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion

}
}

WebForm1.aspx
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="MyWebApp.WebForm1" %><!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"
<HTML><HEAD><title>WebForm1</title><meta name="GENERATOR"
Content="Microsoft Visual Studio 7.0"><meta name="CODE_LANGUAGE"
Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta
name="vs_targetSchema"
 

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,009
Latest member
GidgetGamb

Latest Threads

Top