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 Back Button in Internet Browser

how to disable Back Button in Internet Browser

Scheduled Pinned Locked Moved ASP.NET
helptutorial
3 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.
  • B Offline
    B Offline
    ballameharmurali
    wrote on last edited by
    #1

    Hi all, Do anybody have the code for disabling the back button in Internet Browsers. I have tried this code but this isnt working : window.history.forward(1); I even placed in the head section but it is not working. can u please help me since it is very urgent to me Regards, murali

    A J 2 Replies Last reply
    0
    • B ballameharmurali

      Hi all, Do anybody have the code for disabling the back button in Internet Browsers. I have tried this code but this isnt working : window.history.forward(1); I even placed in the head section but it is not working. can u please help me since it is very urgent to me Regards, murali

      A Offline
      A Offline
      ABitSmart
      wrote on last edited by
      #2

      ballameharmurali wrote:

      window.history.forward(1);

      This code does not disable the back button, it is just navigation hack which could fail with browser version and also disabling javascript. You cannot/shouldn't disable the back button. Rather than relying on the browser you should design your system(presuming there is a server side) to detect/prevent the user's activity.

      1 Reply Last reply
      0
      • B ballameharmurali

        Hi all, Do anybody have the code for disabling the back button in Internet Browsers. I have tried this code but this isnt working : window.history.forward(1); I even placed in the head section but it is not working. can u please help me since it is very urgent to me Regards, murali

        J Offline
        J Offline
        Jitendra R Wadhwani
        wrote on last edited by
        #3

        HI, please ensure following to get the desired result. (I AM ASSUMING YOU ARE USING ASP.NET 2.0 AND C#) Simply use the page directive OutputCache Location = "none". This should help. If not do let me know, the behavior faced.

        PLEASE DO NOT FORGET TO MARK AS ANSWER IF FOUND USEFUL/RELEVANT, SO THAT OTHERS CAN FIND IT EASILY. Software Developer, Pune, India

        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