Philip Hendry's Blog
Sporadic musings from Philip Hendry

IE8 Caches jQuery Ajax results

Jan 6, 2010 • ASP.NET MVC, jQuery • Less than a minute read

In my client code I have a small chunk of javascript that fetches the data for my form asynchronously using Ajax :  Read →

Numbering XML Elements in T-SQL

Jan 5, 2010 • T-SQL • 1 min read

I had a problem where I wanted to convert a chunk of XML passed to a T-SQL stored procedure into a relational model but at the same time number the elements. I used row_number() but that required an order by clause and I actually wanted to maintain the original order of the elements and not apply any other ordering. Initially I tried adding order by 1 to try and fool it into apply ‘no order’ but that didn’t work, instead I replaced the 1 with rand(). Because rand() is not recomputed for each row it effectively orders by a single number which is the equivalent of order by 1. Here’s the code :  Read →

Sending and Receiving JSON between jQuery and ASP.NET MVC using Ajax.

Dec 22, 2009 • ASP.NET MVC, jQuery • 10 min read

It’s taken me a while to get this working without any problems so it’s worth jotting down how it all works. I don’t think I was trying to do anything particularly difficult – just receive Json from an ASP.NET MVC application using jQuery then submitted but the APIs had to be coerced into just the correct way to get it functional.  Read →