jQuery used with ASP.NET - The Perfect Complementary Technology
In the Fall of 2008 on his website, Scott Guthrie, Microsoft manager of the ASP.NET Development Team, announced that Visual Studio 2008 Service Pack 1 with ASP.NET MVC would include the jQuery open source library. He wrote:
“jQuery is a lightweight open source JavaScript library (only 15kb in size) that in a relatively short span of time has become one of the most popular libraries on the web."
"A big part of the appeal of jQuery is that it allows you to elegantly (and efficiently) find and manipulate HTML elements with minimum lines of code. jQuery supports this via a nice "selector" API that allows developers to query for HTML elements, and then apply "commands" to them. One of the characteristics of jQuery commands is that they can be "chained" together - so that the result of one command can feed into another. jQuery also includes a built-in set of animation APIs that can be used as commands. The combination allows you to do some really cool things with only a few keystrokes."
jQuery now is an integral part of VS 2010 when an ASP.NET project is created. The jQuery library is a great implementation of client-side JavaScript functions in a library of very easy-to-use JavaScript macros:
JQuery Introduction
jQuery allows the ASP.NET developer to:
- Traverse the Document Object Model (DOM) tree with just a few lines of code to manipulate or check elements of the HTML or ASPX page.
- Easily change the appearance of an HTML or ASPX page with the power of CSS 3.0 style properties.
- Use the API to alter the contents of an HTML or ASPX page in short, concise jQuery code snippets.
- Perform AJAX calls to server-side page methods to securely access database information through MVC classes or web/WCF services.
- Interact with the user by binding events and properties to an HTML or ASPX page elements to produce powerful and elegant visual effects that also maintain state in the client with browser caching.
Create reuable jQuery plug-ins as custom extensions that can be shared across an entire application.
The core functionality of jQuery can be divided into 3 main areas useful to ASP.NET programmers:
1. DOM HTML or ASPX page query and manipulation with selectors and filters
2. Powerful, but easy special effects and animation
3. AJAX calls with functions for working with JSON