Using jQuery with ASP.NET

As this post is about 'using jQuery with ASP.NET' so we will not be looking into 'What is jQuery' and 'How to use jQuery' assuming you know basics of jQuery. If not, then please read 'Learn how to use jQuery?'
Visual Studio Code includes built-in JavaScript IntelliSense, debugging, formatting, code navigation, refactorings, and many other advanced language features. Most of these features just work out of the box, while some may require basic configuration to get the best experience. This page summarizes the JavaScript features that VS Code ships with. Download Free Files API. In this article I will explain how to debug JavaScript or jQuery code in IE (Internet Explorer) using Visual Studio debugger. Add the keyword debugger to the line where you want the debugger to halt the code execution as show below and then run the Visual Studio in Debug mode by pressing F5 or using the Debug button. To begin with using jQuery with ASP.NET, first download the latest version the jQuery library from jQuery website and unzip or copy the file in your project or Visual studio solution. Microsoft Visual studio 2010 and 2012 include jQuery by default and provide intellisense to use jQuery.
To begin with using jQuery with ASP.NET, first download the latest version the jQuery library from jQuery website and unzip or copy the file in your project or Visual studio solution. Microsoft Visual studio 2010 and 2012 include jQuery by default and provide intellisense to use jQuery. Assuming that you have placed the library in Script folder, add this in the head of your ASP.NET page (simple or master). (Its a good practice to keep your all js file under Script folder).
Or you can directly refer them using various CDNs. Put this line of code in head section of ASP.NET Page.
In the above code, I have not used 'http' protocol while referencing jQuery from Google CDN. Its not a mistake rather always use protocol less URL for referencing jQuery.
After this setup, you can use jQuery in your ASP.NET page. Let's see a demo.

Show alert window on click of ASP.NET Button.
Assuming a ASP.NET button with ID 'btnSubmit ' is placed on the page.
And now bind the click event to ASP.NET Button in document.ready section.
In above jQuery code block, we have attached click event to the button using ID selectors. Read more about other jQuery selectors and how to use them.

Below is a list of useful jQuery code example for ASP.NET controls that we use on daily basis. One thing, while creating object of any ASP.NET control, always use ClientID. As when Master pages are used then the ID of the ASP.NET controls is changed at run time. Read more here. But with ASP.NET 4.0, this is changed and now you have control over the Client ID using ClientIDMode property.
Get label value:
Set label value:
Get Textbox value:
Set Textbox value:
Get Dropdown value:
Set Dropdown value:
Get text of selected item in dropdown:
Get Checkbox Status:

Check the Checkbox:
Uncheck the Checkbox:
Get Radiobutton Status:
Check the RadioButton:
Uncheck the RadioButton:
Disable any control:
Enable any control:
Make textbox read only:
I had already posted many ASP.NET related post and below you find links some useful posts.
Visual Studio Code Jquery Intellisense Not Working
Feel free to contact me for any help related to jQuery, I will gladly help you.
Visual Studio Code For Windows
