By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,288 Members | 3,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,288 IT Pros & Developers. It's quick & easy.

ASP.NET Server.ScriptTimeout being ignored

P: n/a
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>
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <xyz@nospam@bovac@massdor.@..com> wrote in message
news:B6**********************************@microsof t.com...
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"
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>

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.