Hi,
I am creating a .aspx page to respond to ajax requests.
If I return json back, how do I set the content type so my calling page receives the JSON properly?
I'm using jquery if that matters.
Hi,
I am creating a .aspx page to respond to ajax requests.
If I return json back, how do I set the content type so my calling page receives the JSON properly?
I'm using jquery if that matters.
I would suggest against using an ASPX page that way.
An ASMX web service or even ASHX HttpHandler would be better. When you make a call to an ASPX page, the Page class must be instantiated even if you're just using Response.Write() to output JSON. It's a lot of unnecessary overhead to add to what should be a lightweight call.