6 Sept 2012

ASPNETDB ASP.NET Application Services Membership GUI

I'm not a big fan of the ASPNETDB framework - seems needlessly complicated while still not doing many things that you want from your membership system.

But if you have to use it, one thing that really bugs me is that it doesn't have a simple way to remotely manage the users and roles. Here's a tool to lighten the load, a WinForms GUI app: http://sourceforge.net/projects/aspnetdb/

5 Sept 2012

IE, jquery, migrating from live to on for click events

Had a bit of "fun" today migrating from using jquery live() to on(). I had a bit of code like this:

$('.BizCard.selectable').live('click', function () { blah; });

Knowing that we should now use the on() function instead, I changed it to:

$(window).on('click', '.BizCard.selectable', function () { blah; });

This seemed to work OK until I got a bug report that it wasn't working in IE8 and lower. Took a while to work it out, but turns out you can't attach a click handler to the window object in IE before IE9. Therefore the workaround was to attach to document instead:

$(document).on('click', '.BizCard.selectable', function () { blah; });

An aide-memoire on setting cookies, reading cookies with jQuery

Assuming we use jquery.cookie.js, to SET a boolean cookie flag:
$.cookie("AutoShow_" + handle, isExpanding ? 'true' : 'false');
and to read it back
var shouldShow = /true/i.test($.cookie("AutoShow_" + handle));
If I helped you out today, you can buy me a beer below. Cheers!