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. Web app not calling Application_End

Web app not calling Application_End

Scheduled Pinned Locked Moved C#
helpquestion
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.
  • I Offline
    I Offline
    IrishSonic
    wrote on last edited by
    #1

    Hiya I have a normal web app with many forms. My problem is that when I close the web app with the red X in internet explorer, Application_End in Global.asax does not get called to clean up my varibles. Am I doing something wrong?? Thanks

    L H 2 Replies Last reply
    0
    • I IrishSonic

      Hiya I have a normal web app with many forms. My problem is that when I close the web app with the red X in internet explorer, Application_End in Global.asax does not get called to clean up my varibles. Am I doing something wrong?? Thanks

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      IrishSonic wrote: Am I doing something wrong?? You dont expect your visitor to shutdown the web site now? :sigh: top secret xacc-ide 0.0.1

      1 Reply Last reply
      0
      • I IrishSonic

        Hiya I have a normal web app with many forms. My problem is that when I close the web app with the red X in internet explorer, Application_End in Global.asax does not get called to clean up my varibles. Am I doing something wrong?? Thanks

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        First of all, this question belong in the ASP.NET forum, but since it's a simple question I'll answer it here anyway. The red X in IE (or any browser) does nothing on the server. HTTP is a client-request/server-response mechanism and only client-side scripting events would know that your browser is closing. Also, if you read the documentation for ASP.NET (always a good thing), the Application_End handler executes when your ASP.NET web application is shutting down (as leppie tried to point out with little extra helpful information). Each client does not get a separate instance of a web application - that would be stupid (wouldn't scale well, among many other things). Each additional client gets a separate context (a thread), optionally with a session attached. If you want to store information per-client and clean it up, use the Session property found on many objects (like HttpContext, Page, et. al.) and handle clean-up in the Session_End handler in Global.asax. This still won't fire when a user closes the browser, however. It will fire when the session is destroyed. The default is in 30 minutes. Please direct future questions to the appropriate forums. This is an ASP.NET related question - it doesn't matter if you wrote it in C# or not; C# is just one many languages that target and use the .NET Framework.

        Microsoft MVP, Visual C# My Articles

        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