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. how to end session..?

how to end session..?

Scheduled Pinned Locked Moved ASP.NET
helpsysadmintutorialquestion
7 Posts 3 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.
  • C Offline
    C Offline
    chubbie
    wrote on last edited by
    #1

    i have this logout button in my application. when someone clicks on the button, he will be redirected to another page to confirm if he wants to log out. the code behind, i type

    Session.Abandon();

    and i also add in

    Server.Transfer("login.aspx");

    this part works perfectly alright.. it redirects me to the page that i want. but when i hit the backspace on the keyboard, or click on the back arrow in the browser, the page is back to the confirmation page for logout. and if i did some editing in the application, like edit user details and submit (INSERT command).. the whole thing hang, and prompts me error. how should i do, so that, when the user click or press the backspace, the "Page is Expired" will appear, instead of my confirmation for logout? i need help here. have been struggling for long. -DarkangeL-

    P 1 Reply Last reply
    0
    • C chubbie

      i have this logout button in my application. when someone clicks on the button, he will be redirected to another page to confirm if he wants to log out. the code behind, i type

      Session.Abandon();

      and i also add in

      Server.Transfer("login.aspx");

      this part works perfectly alright.. it redirects me to the page that i want. but when i hit the backspace on the keyboard, or click on the back arrow in the browser, the page is back to the confirmation page for logout. and if i did some editing in the application, like edit user details and submit (INSERT command).. the whole thing hang, and prompts me error. how should i do, so that, when the user click or press the backspace, the "Page is Expired" will appear, instead of my confirmation for logout? i need help here. have been struggling for long. -DarkangeL-

      P Offline
      P Offline
      Pinto1
      wrote on last edited by
      #2

      if(window.history.forward(1) != null) window.history.forward(1); Put this between the tags of your page and it will disable the back button.:-D -- modified at 9:24 Wednesday 15th March, 2006

      C 1 Reply Last reply
      0
      • P Pinto1

        if(window.history.forward(1) != null) window.history.forward(1); Put this between the tags of your page and it will disable the back button.:-D -- modified at 9:24 Wednesday 15th March, 2006

        C Offline
        C Offline
        chubbie
        wrote on last edited by
        #3

        hmm i am using visual studio 2005.. and the code behind is C#.. componenets used is asp .net 2.0.. can i use the method you gave me? -DarkangeL-

        P E 2 Replies Last reply
        0
        • C chubbie

          hmm i am using visual studio 2005.. and the code behind is C#.. componenets used is asp .net 2.0.. can i use the method you gave me? -DarkangeL-

          P Offline
          P Offline
          Pinto1
          wrote on last edited by
          #4

          I am using Visual Studio .Net 2003 and asp.net I do not know anything about C# and if it affects the HTML. Try it and see what happens :~

          1 Reply Last reply
          0
          • C chubbie

            hmm i am using visual studio 2005.. and the code behind is C#.. componenets used is asp .net 2.0.. can i use the method you gave me? -DarkangeL-

            E Offline
            E Offline
            eggie5
            wrote on last edited by
            #5

            the javascript pinto1 gave you goes in your .aspx page, i.e. your html page, not your aspx.cs page i.e. codebehind page. /\ |_ E X E GG

            C 1 Reply Last reply
            0
            • E eggie5

              the javascript pinto1 gave you goes in your .aspx page, i.e. your html page, not your aspx.cs page i.e. codebehind page. /\ |_ E X E GG

              C Offline
              C Offline
              chubbie
              wrote on last edited by
              #6

              oh.. so i just add the code he gave me to the aspx's html page tag right? and it doesnt matter what i use for my programming tools right? -DarkangeL-

              E 1 Reply Last reply
              0
              • C chubbie

                oh.. so i just add the code he gave me to the aspx's html page tag right? and it doesnt matter what i use for my programming tools right? -DarkangeL-

                E Offline
                E Offline
                eggie5
                wrote on last edited by
                #7

                Yes, put it in the head section. NO, you can do it in any program because javascript isn't compiled... /\ |_ E X E GG

                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