JavaScript Query String
Posted by Chris | Filed under JavaScript
Query Strings
When I started coding more client-side JavaScript in replace of ASP.NET code, I was surprised to find there there’s no object in JavaScript that breaks down a query string into a key (or name)/value collection, as this.Request.QueryString does in ASP.NET.
Here’s a URL with a query string:
http://prettycode.com/search?query=code&pageSize=20
The query string is everything that including and [...]
Tags: ASP.NET, JavaScript, query string, querystring
Add a CSS Class in ASP.NET
Posted by Chris | Filed under ASP.NET, CSS
Adding or removing a CSS class to an element in jQuery is easy enough:
$("#elementId").addClass("className");
$("#elementId").removeClass("className");
But how can this be done in ASP.NET? Shouldn’t it be as easy? Should? Yes. Is? Almost. For the quick solution and code, jump to the end of this post. (That’s what this is really here for anyway—to host the code for [...]
Simplify jQuery with ASP.NET Web Services and JSON
Posted by Chris | Filed under ASP.NET, Ajax, jQuery
Introduction
In my last post, I gave a quick introduction to using jQuery for JSON communication with ASP.NET web and WCF services. It’s not very complicated, but it’s distinct enough from consuming XML or other services to warrant a little explaining.
In this post, I’m going to suggest you save yourself of writing out or copying/pasting that [...]
Tags: Ajax, ASP.NET, ASP.NET AJAX, JavaScript, jQuery, JSON, JSON dates, parse JSON dates, web services
Using jQuery with ASP.NET Web Services and JSON
Posted by Chris | Filed under ASP.NET, Ajax, jQuery
By now, hopefully everyone’s played with jQuery for client-side JavaScript work and knows it eliminates the fuss of manually writing Ajax code. In this post, I’ll briefly cover the idiosyncrasies of using jQuery Ajax to consume .NET 3.5 web services that serve JSON. Although I mostly show examples of ASPX pages with WebMethods, all the [...]
Tags: Ajax, ASP.NET, ASP.NET AJAX, JavaScript, jQuery, JSON, JSON dates, parse JSON dates, web services