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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Determine whether page is posting back in Page_Unload or Dispose method

Determine whether page is posting back in Page_Unload or Dispose method

Scheduled Pinned Locked Moved ASP.NET
question
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.
  • C Offline
    C Offline
    chubbysilk
    wrote on last edited by
    #1

    Hello, Is there any way to tell whether a page is going to be posted back, closed, or redirected, in the Page_Unload or Dispose methods? Basically, if a page is not being posted back, I would like a reset a particular session variable. Any ideas would be much appreciated. Thanks, RC

    S N 2 Replies Last reply
    0
    • C chubbysilk

      Hello, Is there any way to tell whether a page is going to be posted back, closed, or redirected, in the Page_Unload or Dispose methods? Basically, if a page is not being posted back, I would like a reset a particular session variable. Any ideas would be much appreciated. Thanks, RC

      S Offline
      S Offline
      Sarvesvara BVKS Dasa
      wrote on last edited by
      #2

      chubbysilk wrote: whether a page is going to be posted back, closed, or redirected, in the Page_Unload or Dispose methods? Basically, if a page is not being posted back, I dont understand the thing u need... do u want to predict, if the user is not going to click or do any actions that would trigger any post back??? U can better change the logic of ur session variable resetting!! I was born intelligent
      Education ruined me!.

      1 Reply Last reply
      0
      • C chubbysilk

        Hello, Is there any way to tell whether a page is going to be posted back, closed, or redirected, in the Page_Unload or Dispose methods? Basically, if a page is not being posted back, I would like a reset a particular session variable. Any ideas would be much appreciated. Thanks, RC

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

        Use IsPostBack. You won't be able tell if the use closes the browser or navigates away from your page because no post is sent, unless you have some javascript to force it.

        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