jQuery Confirm box to leave or remain on a page
<p>I have an MVC2 C#.Net web app. When a user attempts to leave a view, I want to pop up a confirm box to alert them that they have made changes but not yet saved. </p>

<p>In a previous .Net 3.5 app, I used <code>window.onbeforeunload</code>. That doesn't seem to work in MVC3. What would be an appropriate place or event to call to do this type of activity? </p>
