Advertisment

Working with JQuery in ASP.NET using Visual Studio

author-image
PCQ Bureau
New Update

Visual Studio 2008 contains a large number of new features. One of the most

useful feature being client-side JavaScript debugging. Using this feature, you

can set up breakpoints in JavaScript in your ASP.NET page or in a .JS file and

hit it when debugging. You can view values of variables, change code on the fly

and more.

Advertisment

However, JavaScript is still a language where one needs to write quite a bit

of code to work. This is where the JQuery open source JavaScript library comes

in. JQuery is a very small but very powerful library in JavaScript that allows

you to manipulate elements on the page with very minimal code. JQuery has a

complete API consisting of 'selectors' (elements on the page), 'actions'

(commands that you can run against them) and 'animations.' This article however,

does not delve deeply into the command syntax. Instead it shows how you can

combine the power of Visual Studio, ASP.NET and JQuery in one integrated

environment.

The download page

for JQuery allows you to get the release version as well as JQuery

documentation for Visual Studio/VWD 2008.
Using JQuery in

VS/VWD is as simple as dragging both files into Solution Explorer.

We will use JQuery for a small application on ASP.NET using the free Visual

Web Developer 2008 SP1 that is available from Microsoft at www.asp.net or from

this month's PCQ DVD. You will also need to get a few other items as well to get

this to work.

Advertisment
Start typing

JQuery code and IntelliSense picks up and shows documentation for it in

detail.

First off, install the Visual Web Developer 2008 (VWD) on your machine. You

also need to download support for “-vsdoc.js IntelliSense” from http://tinyurl.com/

vsdocpatch. Once this is installed, head over to the JQuery site at

www.jquery.com. Go to the Download section and get the “Minified” and the

“Documentation: Visual Studio” files. Rename them to jquery.js and

jquery-vsdoc.js and put both files into your ASP.NET application folder by

dragging and dropping them into the Solution Explorer in VWD.

The documentation

works at the first level...

To use the JQuery library in your ASP.NET page, simply use a

Advertisment