Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Server.Transfer("somepage.aspx") from within Session_End

Server.Transfer("somepage.aspx") from within Session_End

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devvvy
    wrote on last edited by
    #1

    Hi, trying to: (Global.asax.vb) Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) Server.Transfer("somepage.aspx") Return End Sub No exception, but the redirection didn't work. Any idea? Thanks in advance. Norman Fung

    T C 2 Replies Last reply
    0
    • D devvvy

      Hi, trying to: (Global.asax.vb) Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) Server.Transfer("somepage.aspx") Return End Sub No exception, but the redirection didn't work. Any idea? Thanks in advance. Norman Fung

      T Offline
      T Offline
      TurokHan
      wrote on last edited by
      #2

      This is not possible. Session_End fires (standard) 30 minutes after the user made his last action on the website. It is not possible to transfer your user to a page when he leaves the site. (Not with asp.net anyway, maybe with javascript or something)

      A 1 Reply Last reply
      0
      • D devvvy

        Hi, trying to: (Global.asax.vb) Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) Server.Transfer("somepage.aspx") Return End Sub No exception, but the redirection didn't work. Any idea? Thanks in advance. Norman Fung

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        norm wrote: No exception, but the redirection didn't work. Any idea? Not really. What are you actually trying to achieve? By that, I mean at a higher level, not this particular task - I get the feeling that you have gone down the wrong road somewhere and you are stuck on that track. It might be better to back up slightly and re-examine the overall problem.


        Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

        1 Reply Last reply
        0
        • T TurokHan

          This is not possible. Session_End fires (standard) 30 minutes after the user made his last action on the website. It is not possible to transfer your user to a page when he leaves the site. (Not with asp.net anyway, maybe with javascript or something)

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          So anyone knows how to do it? I mean redirect to a page when session expires. Thanks a bunch.

          C 1 Reply Last reply
          0
          • A Anonymous

            So anyone knows how to do it? I mean redirect to a page when session expires. Thanks a bunch.

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            When the user makes a new request after a session has ended the ASP.NET server will start a new session. If there is a way to detect that the page they are trying to access is invalid for the first page request in a session you can redirect them at the session start. If you need to automatically log the user out after a set amount of time you need to write some javascript to do that. The javascript can then redirect the user to the page. However, some people turn javascript off, so you cannot rely on that completely.


            Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups