About the author

Vijay Kodali
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Detecting Asp.Net page close event

Sometimes we have to capture page close event or navigation event to alert users. For example, Alerting user for navigating away from input page without saving it. Check this java script code..

window.onbeforeunload= function(){
if((window.event.clientX<0) || (window.event.clientY<0))
    {
      event.returnValue = "Are you sure you want to navigate away from this page? You haven't saved this form.";
    }
};

This code works only in Ie6/7. And also keep in mind, we can never catch the browser close event for 100%. For example, what if the user kills the browser process or shut down OS.


Tags:
Posted by vijay on Thursday, March 20, 2008 2:49 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Great tool for LINQ -LINQPAD

you could test a LINQ query without pressing F5 in Visual Studio..

http://www.linqpad.net/

 the tool also includes all the samples from the book "C# 3.0 in a Nutshell" written by Joseph Albahari


Categories: C# | LINQ
Posted by vijay on Wednesday, March 12, 2008 10:18 AM
Permalink | Comments (1) | Post RSSRSS comment feed