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. General Programming
  3. C#
  4. Closing a Webform by clicking the close button

Closing a Webform by clicking the close button

Scheduled Pinned Locked Moved C#
questioncsharpasp-net
4 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.
  • T Offline
    T Offline
    TheMajorRager
    wrote on last edited by
    #1

    Is there an event or function that is fired when the user clicks the close button at the upper right portion of the screen of a WEB PAGE? And if there is, what is it? I am working on this ASP.NET project, and I want to output a message box when that button is clicked. Thank you, The Major Rager

    M E D 3 Replies Last reply
    0
    • T TheMajorRager

      Is there an event or function that is fired when the user clicks the close button at the upper right portion of the screen of a WEB PAGE? And if there is, what is it? I am working on this ASP.NET project, and I want to output a message box when that button is clicked. Thank you, The Major Rager

      M Offline
      M Offline
      Marc 0
      wrote on last edited by
      #2

      Maybe this should be in the Web Development forum... I think (not sure) the <body> tag has a onClosing event or something: <html onClosing="DoSomethingWithJavascriptOrSomething"> How you can use this with Asp.Net i have no idea :~ . Pompiedompiedom... ;)


      "..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.." -- Mark McCormick

      1 Reply Last reply
      0
      • T TheMajorRager

        Is there an event or function that is fired when the user clicks the close button at the upper right portion of the screen of a WEB PAGE? And if there is, what is it? I am working on this ASP.NET project, and I want to output a message box when that button is clicked. Thank you, The Major Rager

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        Hi there, You can hook on OnUnload event of the web form by using js.... << >>

        1 Reply Last reply
        0
        • T TheMajorRager

          Is there an event or function that is fired when the user clicks the close button at the upper right portion of the screen of a WEB PAGE? And if there is, what is it? I am working on this ASP.NET project, and I want to output a message box when that button is clicked. Thank you, The Major Rager

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Just as the other two people have said. But, this event can't be handled server-side in ASP.NET. There is no event for it. You can only handle this event in client-sie JavaScript. But, this is really a question for the ASP.NET or Web Development forums. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          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