Thursday, May 8, 2008

Cookie glitch in Vista/IE7?

Hrm...

Found an odd one. My login code, which has worked fine for years, was having trouble today. Jane at Logosdor complained that she couldn't log in. I tried to test it on mine, only to find that I couldn't log OUT!

Pretty extensive debugging and diagnostics ensued, only to find that:

* It all worked perfectly under Firefox
* Under IE, the authentication cookie was not being saved on my machine
* My cookie file for the site APPEARED to have not been updated since January (4 months), according to IECV (Inernet Explorer Cookie Viewer).

So... was IE7 under Vista failing to update my cookie files? I performed ye olde "delete cookies" and... it worked fine afterwards.

Be nice to get to the bottom of this one day. Until then, might have to hand out the obligatory "delete all your cookies" advice to anyone having trouble. Making me sound just like a Microsoft technician...

Actually... the Net was playing up today. A bit slow. This hasn't happened before... I wonder if cookies were somehow being stripped from the web response? Nah... if that's the case it should have still failed after the mass deletion.

Thursday, May 1, 2008

AjaxControlToolkit TabContainer not maintaining ActiveTabIndex between postbacks - Workaround

Problem
The AjaxControlToolkit TabContainer does not maintain the state of its ActiveTabIndex if the postback is caused by a GridView or DataList.

Workaround
Add the following javascript to your page:

<script type="text/javascript">
function OnTabContainer_ActiveTabChanged(sender, args)
{
sender.get_clientStateField().value = sender.saveClientState();
}
</script>

And add the following attribute to your TabContainer:


OnClientActiveTabChanged="OnTabContainer_ActiveTabChanged"