Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2003, 07:49 PM
Registered User
 
Join Date: Dec 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to increase timeout on aspx page?

C# page gets data from a stored procedure. The procedure itself takes over 45 seconds and does not time out when run in Query Analyzer, but the page times out after ~30 seconds.

Session is set to 20 minutes.

So how to increase timeout period on that page? Thanks.

Funtent

 
Old December 12th, 2003, 05:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I haven't got the right answer for you, but I know how to do it in Classic ASP, and it will perhaps help you. I do not think it is about your session; I think it is a Server.ScriptTimeout issue, since this would do the trick in ASP...
Code:
<% Server.ScriptTimeout = 240 %>
more info. I had a similar problem where I needed to check for dead links in my database; that is, running some requests on each link in the DB, but if too many links were present I would get a timeout.

Hope it helps.

Jacob.

 
Old December 12th, 2003, 11:31 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Yes, Jacob is correct here. It's the same in ASP.net:

HttpServerUtility.ScriptTimeout Property
Gets and sets the request time-out in seconds.

[C#]
public int ScriptTimeout {get; set;}

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 20th, 2003, 01:23 AM
cjo cjo is offline
Authorized User
 
Join Date: Oct 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My understanding is that ADO.NET has a better way. In your connection string add another argument to increase the connection timeout (default is 15 seconds). For example:

server=(local)\NetSDK;database=Northwind;integrate d security=true;connection timeout=60;
 
Old December 20th, 2003, 02:57 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well, we are talking about two different things here.

One is setting the timeout of the ASPX page, the other is setting the timeout of the SQL connection.

Which do you want to set? If you have a very hefty query, you'll need to adjust both accordingly. There's little sense in increasing the DB connection timeout if the ASPX is going to dump before the DB does.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 10th, 2004, 10:55 AM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For a hefty query, which is the case here as well, (since the process takes more than 45 secs to complete), you should adjust the CommandTimeout within your command object. By adjusting the connection timeout you just state the allowed time in seconds that the process will wait before it quits trying to GET a valid connection to the database, but when you already have a valid connection to the DB, then you need time to EXECUTE your query properly.

Rastaspace

Quote:
quote:Originally posted by planoie
 Well, we are talking about two different things here.

One is setting the timeout of the ASPX page, the other is setting the timeout of the SQL connection.

Which do you want to set? If you have a very hefty query, you'll need to adjust both accordingly. There's little sense in increasing the DB connection timeout if the ASPX is going to dump before the DB does.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
increase caching size in Classic ASP page crmpicco Classic ASP XML 0 April 4th, 2006 11:28 AM
How to Increase page width rajukurian Crystal Reports 2 June 10th, 2005 01:53 AM
How to pass variables from Aspx page to Asp Page jayaraj Classic ASP Basics 2 May 23rd, 2004 06:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.