p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: Distinguish when user closes form


Message #1 by andrew@s... on Thu, 6 Mar 2003 21:34:21
Hello,

Is there any way to have an asp.net form automatically post back after a 
set interval?

Currently, I am using a http-quiv="refresh" Content="5" meta statement.  
The problem is that this causes the form_unload overrider to fire which I 
don't want.  I want the unload to fire only if the user closes the browser 
or clicks the cancel button, not when the form is refreshed.

Thank you,

Andrew
Message #2 by "ksh pandey" <k****ij_jbp_2001@r...> on 7 Mar 2003 04:06:46 -0000
Hi

u can have a cookie/session variable  set it to true /false  to 
decide weather form_unload  has ti fire or not .

Ex
form_unload
{
if variable is true then
{
/// all coe in ur unload  procedure goes here
}
}

And with every refresh set the variable to false
and when browser is closed / cancel is clicked then set it to 
true


enjoy
hope this helps!!!
K****ij Pandey





On Fri, 07 Mar 2003 andrew@s... wrote :
>Hello,
>
>Is there any way to have an asp.net form automatically post back 
>after a
>set interval?
>
>Currently, I am using a http-quiv="refresh" Content="5" meta 
>statement.
>The problem is that this causes the form_unload overrider to fire 
>which I
>don't want.  I want the unload to fire only if the user closes 
>the browser
>or clicks the cancel button, not when the form is refreshed.
>
>Thank you,
>
>Andrew
>---
>Professional Design Patterns in VB.NET:
>Building Adaptable Applications
>
>Want to know how design patterns bring reusable
>design and adaptabilty to your applications? How
>to recognize the need for a design pattern
>solution? How to select, design, and implement
>the right patterns? How parts of the .NET Framework
>(like the .NET Data Providers and .NET Remoting)
>take advantage of design patterns? This book
>presents a practical approach to using design
>patterns in VB.NET, by focusing on the relevance
>of design patterns in the different tiers of a
>distributed n-tier architecture.
>
>http://www.wrox.com/books/1861006985.htm
>





  Return to Index