Results 1 to 6 of 6

Thread: (RESOLVED) Managing Page TimeOut

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Resolved (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
    Last edited by BruceG; Oct 20th, 2009 at 01:04 PM. Reason: resolved
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    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.
    "It's cold gin time again ..."

    Check out my website here.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  5. #5

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    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.
    "It's cold gin time again ..."

    Check out my website here.

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width