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. show alert message when browser tab is closed

show alert message when browser tab is closed

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nettutorial
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.
  • A Offline
    A Offline
    ashok techxygen
    wrote on last edited by
    #1

    hi all, how to show confirm alert message when the user closes the browser tab in asp.net using javascript...

    Ashok

    S S 2 Replies Last reply
    0
    • A ashok techxygen

      hi all, how to show confirm alert message when the user closes the browser tab in asp.net using javascript...

      Ashok

      S Offline
      S Offline
      saanj
      wrote on last edited by
      #2

      There is no straight forward way to achieve this. However, you can check the folowing link: http://aspadvice.com/blogs/getwhatyouwant/archive/2006/09/20/bypass-_2200_The-Web-page-you-are-viewing-is-trying-to-close-the-window_2200_-_2D00_-_2800_simple_2900_.aspx[^] Regards Saanj

      Either you love IT or leave IT...

      1 Reply Last reply
      0
      • A ashok techxygen

        hi all, how to show confirm alert message when the user closes the browser tab in asp.net using javascript...

        Ashok

        S Offline
        S Offline
        satigar123
        wrote on last edited by
        #3

        var displayPrompt=true; if (displayPrompt){ event.returnValue = "are you sure to close?"; }

        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