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. displaying messagebox when user clicks browser back button

displaying messagebox when user clicks browser back button

Scheduled Pinned Locked Moved ASP.NET
helpquestion
7 Posts 5 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.
  • L Offline
    L Offline
    laziale
    wrote on last edited by
    #1

    hello - I want to display message once the user will click the back button from some browser. There should be buttons with ok and cancel, if the user select ok then he will be redirected to the previous page, if he clicks cancel then he will stay at the current page. any help, advices...? thanks ahead

    A N 2 Replies Last reply
    0
    • L laziale

      hello - I want to display message once the user will click the back button from some browser. There should be buttons with ok and cancel, if the user select ok then he will be redirected to the previous page, if he clicks cancel then he will stay at the current page. any help, advices...? thanks ahead

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      laziale wrote:

      I want to display message once the user will click the back button from some browser.

      AFAIK : You can't do that ! FYI : Capturing the Browser's Back button click[^]

      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

      K 1 Reply Last reply
      0
      • A Abhijit Jana

        laziale wrote:

        I want to display message once the user will click the back button from some browser.

        AFAIK : You can't do that ! FYI : Capturing the Browser's Back button click[^]

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

        K Offline
        K Offline
        Khaja A Imtiaz
        wrote on last edited by
        #3

        we can do this.. Infact just now I saw the similar one in this forum only... when I try to reply one of the post... try by clicking the reply link and enter some text in the space provided and click back button... you can see the effect which you are looking for...

        Imtiaz A.K

        1 Reply Last reply
        0
        • L laziale

          hello - I want to display message once the user will click the back button from some browser. There should be buttons with ok and cancel, if the user select ok then he will be redirected to the previous page, if he clicks cancel then he will stay at the current page. any help, advices...? thanks ahead

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          You can attempt this in two ways 1) Disable the back button (plenty of examples for that) and handle the backward navigation from controls on your page. 2) Handle the onUnload event in JavaScript and determine if it came from the back button


          only two letters away from being an asset

          L 1 Reply Last reply
          0
          • N Not Active

            You can attempt this in two ways 1) Disable the back button (plenty of examples for that) and handle the backward navigation from controls on your page. 2) Handle the onUnload event in JavaScript and determine if it came from the back button


            only two letters away from being an asset

            L Offline
            L Offline
            laziale
            wrote on last edited by
            #5

            can you send me a link please from one of those plenty examples. I tried many of them, but nothing is really happening on that specific file, the back button is still enabled. thanks, Laziale

            N C 2 Replies Last reply
            0
            • L laziale

              can you send me a link please from one of those plenty examples. I tried many of them, but nothing is really happening on that specific file, the back button is still enabled. thanks, Laziale

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              http://www.bing.com/search?q=disable+back+button&src=IE-SearchBox&FORM=IE8SRC[^]


              only two letters away from being an asset

              1 Reply Last reply
              0
              • L laziale

                can you send me a link please from one of those plenty examples. I tried many of them, but nothing is really happening on that specific file, the back button is still enabled. thanks, Laziale

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

                Fact is, you cannot reliably turn off the back button. You're better off just fixing your code so that the back button doesn't do anything you don't want it to, such as log people back in.

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                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