In a single line jQuery is a fast, lightweight client side library that is CSS3 compliant and supports almost all browsers. The jQuery framework is extensible and very nicely handles DOM manipulations, CSS, AJAX, Events and Animations. By using JQuery you can dramatically reduce your client side code. Jquery code is completely separate from your HTML code. Around the world many JQuery gurus develops handy plugins for you which you can use to boost up user experience while browsing your application. You can easily integrate JQuery with your AJAX application as well as Microsoft start to provide intelligence on writing JQuery from VS 2008.
Now open your Default.aspx page and include the JQuery library just after the “MainContent” section in your page like below:
Now your application is ready to use JQuery. Ok first we try to write Hello World ! as usual. For this add the below Jquery method just under the above line of reference code:
Now run the project. Hope you will get below output:
Add a button control in your page & run the page & click on the button. You will get Hello World ! message again. To do that add the below HTML markup like below:
<asp:Button runat="server" ID="btn" Text="Click Me" />
To enable Button Click Event by Jquery add the below script Like first one:
Now run the project. You will get first an JQuery alert due to first Jquery script. After that you will get a Button. Now click on the Button, you will get another JQuery alert message “Hello World !”.