Determine whether page is posting back in Page_Unload or Dispose method
-
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
-
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
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!. -
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
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.