Archive for January, 2009
Use jQuery to replace <body onunload="GUnload()">
Posted on January 26th, 2009 • Filed under Javascript • 7 Comments
When using Google maps it’s important to use GUnload on the page’s unload event. Fine when you can access the body tag directly…. But if you have the Google map functionality wrapped inside an ascx you need a different approach.
After a big of digging I found how to use jQuery to “catch” the unload event. In case anyone else needs it:
$(window).unload( function () { GUnload(); } );
Need to access session variables in an ashx?
Posted on January 16th, 2009 • Filed under asp.net • 4 Comments
Just a quick note if you need to access session variables from an ashx, you need to implement SessionState.IRequiresSessionState or IReadOnlySessionState if you only need to read the vars
In your ashx change
Public Class yourclass : Implements IHttpHandler Implements SessionState.IRequiresSessionStat
to
Public Class yourclass Implements IHttpHandler Implements SessionState.IRequiresSessionStat