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 disable the back button of browser ?

How to disable the back button of browser ?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
6 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.
  • P Offline
    P Offline
    piyush_patel1111
    wrote on last edited by
    #1

    I want to disable back button of brower ... Is any property like isBack like for postback the property isPostback is there....

    C A D 4 Replies Last reply
    0
    • P piyush_patel1111

      I want to disable back button of brower ... Is any property like isBack like for postback the property isPostback is there....

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

      sounds like you're going to spend a lot of time on your knees. No, there's no such thing. There are hacks, and they annoy all your users except the ones smart enough to break them. Who are the ones you're worried about in the first place. Asking this question usually means your overall design is broken, a site should not care if the user uses the back button.

      Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

      1 Reply Last reply
      0
      • P piyush_patel1111

        I want to disable back button of brower ... Is any property like isBack like for postback the property isPostback is there....

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        hey... I think if you open the page in a new window, and close the original page, the back button will be disabled.... Try this code for your need function goNewWin() { window.open("backbuttonnewpage.html",'TheNewpop','toolbar=1, location=1,directories=1,status=1,menubar=1, scrollbars=1,resizable=1'); self.close() } [Open New Page](javascript:goNewWin()) you can also try doing this Let Page A calls Page B and user is not allowed to go to Page A from Page B. Put the code below in Page A. window.history.forward(1); I think this will do... :rose: Abhishek Sur

        1 Reply Last reply
        0
        • P piyush_patel1111

          I want to disable back button of brower ... Is any property like isBack like for postback the property isPostback is there....

          D Offline
          D Offline
          D4ever
          wrote on last edited by
          #4

          window.history.forward(1); Add this script tag in Page.aspx Source code at he top under head tag still not getting then revert back

          Darshana Pathak

          1 Reply Last reply
          0
          • P piyush_patel1111

            I want to disable back button of brower ... Is any property like isBack like for postback the property isPostback is there....

            A Offline
            A Offline
            Abhishek Sur
            wrote on last edited by
            #5

            well you may write <script> window.history.forward(1) </script> to every window so that it will try to go forward on every pageload.. if it finds one forward level it will automatically go forward.. this helps you when user click on back button... but this is not a good practice... but you can use.

            Abhishek Sur

            D 1 Reply Last reply
            0
            • A Abhishek Sur

              well you may write <script> window.history.forward(1) </script> to every window so that it will try to go forward on every pageload.. if it finds one forward level it will automatically go forward.. this helps you when user click on back button... but this is not a good practice... but you can use.

              Abhishek Sur

              D Offline
              D Offline
              D4ever
              wrote on last edited by
              #6

              but if MasterPage is Used then no need to write it seperately on all pages Just write it on MasterPage that will do

              Darshana Pathak

              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