(RESOLVED) Managing Page TimeOut
Hello,
Currently in my ASP.NET app, I have a timeout feature as requested by the client, implemented as follows in Javascript in my master page (onload event):
Code:
setTimeout("location.href = 'timeout.aspx';", 300000);
So essentially the page will timeout in 5 minutes. This works fine.
However, I would like to suspend this in one instance, where we have a file upload, and would like to know the best way to go about it (i.e. should I use Server.ScriptTimeout here?) Something like:
Code:
' Server.ScriptTimeout for one hour?
Try
FileUpload1.SaveAs("whatever")
Catch ex As Exception
lblErrMsg.Text = "ERROR: " & ex.Message.ToString()
Finally
' set timeout back to 5 minutes
End Try
Re: Managing Page TimeOut
Hey,
What is happening on these pages that you are requesting?
Why the need for the timeout in the first place?
Gary
Re: Managing Page TimeOut
Basically, they want a person to be logged out if there is no activity on the page after five minutes.
However, in the case of a large upload which may take longer than 5 minutes, I want to suspend the rule only during the course of the upload.
Re: Managing Page TimeOut
Hey,
I would tend to shy away from the use of setTimeout, I have found that using this can lead to lots of problems down the line.
I would prefer to handle the timeout of a session using the Session events in the global.asax file of my application.
You can find information about this here:
http://www.abstraction.net/ViewArtic...x?articleID=74
In the web.config file for your application, set the default session timeout, and then when you need to change the timeout, say when you go to the upload page, change the session time out.
Hope that helps!!
Gary
Re: Managing Page TimeOut
Thanks, Gary - I value your input. I will look into what you have suggested. For the time being, I am marking this as resolved.
Re: (RESOLVED) Managing Page TimeOut
Hey,
Not a problem at all.
Let me know how you get on, and if you have any other questions!!
Gary