ASP.NET Cafe
Tips and Tricks

Again Scheduled Task in ASP.NET

Saturday, 15 December 2007 18:12 by Dmitriy

Recently I've explained how to call aspx page on schedule using VB script. But now there are another problem... How long your work ?
Let me explain, ASP.NET server has default timeout... for request. It called Request Timeout. And if your request last longer... thread stopped.
Bad news. Specially, if the work is long by design. I'd a task that downloads fresh content from FTP - about 30mb. And a timeout of 110 second on server. Sometimes my request was kicked (yes, slow and bad server, I know). But what if - no money for Dedicated  where you can setup your own default timeout ?

The answer is very-very simple - this.Server.ScriptTimeout = 1800;

Put this code inside you page Load event handler - and your request timeout - 30 minutes,  not bad at all.

That's all for now.

 

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   ASP.NET
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Preview

January 6. 2009 17:25