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. Avoid Back Button Click

Avoid Back Button Click

Scheduled Pinned Locked Moved ASP.NET
helpquestion
16 Posts 6 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.
  • I Offline
    I Offline
    IamAmit
    wrote on last edited by
    #1

    Hello friends, I wanted to put restrictions on users browser activities. When user logs in ...if he presses "Back" button of the browser...he must not go back to the login page..an error message should be displayed to the user..How can we check that? Thanks In advance

    E C 2 Replies Last reply
    0
    • I IamAmit

      Hello friends, I wanted to put restrictions on users browser activities. When user logs in ...if he presses "Back" button of the browser...he must not go back to the login page..an error message should be displayed to the user..How can we check that? Thanks In advance

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      Not this again.. check this out: http://www.boutell.com/newfaq/creating/backbutton.html http://knowledgebaseworld.blogspot.com/2007/09/how-to-expire-previous-page.html

      I L 4 Replies Last reply
      0
      • I IamAmit

        Hello friends, I wanted to put restrictions on users browser activities. When user logs in ...if he presses "Back" button of the browser...he must not go back to the login page..an error message should be displayed to the user..How can we check that? Thanks In advance

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Why do people ask this day after day ? How does anyone think it's remotely possible ?

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        J 1 Reply Last reply
        0
        • E eyeseetee

          Not this again.. check this out: http://www.boutell.com/newfaq/creating/backbutton.html http://knowledgebaseworld.blogspot.com/2007/09/how-to-expire-previous-page.html

          I Offline
          I Offline
          IamAmit
          wrote on last edited by
          #4

          Thank you very much....

          1 Reply Last reply
          0
          • E eyeseetee

            Not this again.. check this out: http://www.boutell.com/newfaq/creating/backbutton.html http://knowledgebaseworld.blogspot.com/2007/09/how-to-expire-previous-page.html

            I Offline
            I Offline
            IamAmit
            wrote on last edited by
            #5

            [Message Deleted]

            E 1 Reply Last reply
            0
            • I IamAmit

              [Message Deleted]

              E Offline
              E Offline
              eyeseetee
              wrote on last edited by
              #6

              ok well I'm not sure then, this isn't a great feature to try and incoperate anyway, i dont think there is a clear solution to do it

              1 Reply Last reply
              0
              • E eyeseetee

                Not this again.. check this out: http://www.boutell.com/newfaq/creating/backbutton.html http://knowledgebaseworld.blogspot.com/2007/09/how-to-expire-previous-page.html

                I Offline
                I Offline
                IamAmit
                wrote on last edited by
                #7

                hello friend , The code u given is not working. The page is still going back to login page..if user presses Back button..

                1 Reply Last reply
                0
                • C Christian Graus

                  Why do people ask this day after day ? How does anyone think it's remotely possible ?

                  Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                  J Offline
                  J Offline
                  J4amieC
                  wrote on last edited by
                  #8

                  Christian Graus wrote:

                  How does anyone think it's remotely possible ?

                  Becaus every secure system (eg, banking websites) log you out if you try to click back. Obviously this is a much more indepth system than just "avoid user clicking back button", and requires much more work than a simple javascript hack.

                  C I 2 Replies Last reply
                  0
                  • J J4amieC

                    Christian Graus wrote:

                    How does anyone think it's remotely possible ?

                    Becaus every secure system (eg, banking websites) log you out if you try to click back. Obviously this is a much more indepth system than just "avoid user clicking back button", and requires much more work than a simple javascript hack.

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #9

                    Yeah, these folks all ask the wrong question, that's the core problem

                    Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                    1 Reply Last reply
                    0
                    • J J4amieC

                      Christian Graus wrote:

                      How does anyone think it's remotely possible ?

                      Becaus every secure system (eg, banking websites) log you out if you try to click back. Obviously this is a much more indepth system than just "avoid user clicking back button", and requires much more work than a simple javascript hack.

                      I Offline
                      I Offline
                      IamAmit
                      wrote on last edited by
                      #10

                      Offcourse ..It is a bit of difficult code...than just javascript code ...but We need that code..Can anyone help us?

                      E C S 3 Replies Last reply
                      0
                      • I IamAmit

                        Offcourse ..It is a bit of difficult code...than just javascript code ...but We need that code..Can anyone help us?

                        E Offline
                        E Offline
                        eyeseetee
                        wrote on last edited by
                        #11

                        try putting this in your code javascript:window.history.forward(1);

                        C 1 Reply Last reply
                        0
                        • E eyeseetee

                          try putting this in your code javascript:window.history.forward(1);

                          C Offline
                          C Offline
                          Christian Graus
                          wrote on last edited by
                          #12

                          That is close to useless.

                          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                          E 1 Reply Last reply
                          0
                          • I IamAmit

                            Offcourse ..It is a bit of difficult code...than just javascript code ...but We need that code..Can anyone help us?

                            C Offline
                            C Offline
                            Christian Graus
                            wrote on last edited by
                            #13

                            *sigh* It's really very trivial. You CANNOT stop the back button. You CAN make every page check if a session variable is set, and if not, redirect to your login page. I use a base class for this.

                            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                            1 Reply Last reply
                            0
                            • I IamAmit

                              Offcourse ..It is a bit of difficult code...than just javascript code ...but We need that code..Can anyone help us?

                              S Offline
                              S Offline
                              Sherin Iranimose
                              wrote on last edited by
                              #14

                              Hi, Instead of doing a redirect to next page do a javascript location.href='next_page'

                              **$**herin Iranimose

                              1 Reply Last reply
                              0
                              • C Christian Graus

                                That is close to useless.

                                Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                                E Offline
                                E Offline
                                eyeseetee
                                wrote on last edited by
                                #15

                                How come?

                                1 Reply Last reply
                                0
                                • E eyeseetee

                                  Not this again.. check this out: http://www.boutell.com/newfaq/creating/backbutton.html http://knowledgebaseworld.blogspot.com/2007/09/how-to-expire-previous-page.html

                                  L Offline
                                  L Offline
                                  led mike
                                  wrote on last edited by
                                  #16

                                  .netman wrote:

                                  Not this again

                                  hehe At this point we could just about rename CodeProject to that: NotThisAgain.com  :-D

                                  led mike

                                  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