ASP.NET - jquery

Asked By Lavinia Rayan on 09-Jan-12 06:14 AM
hi,
why we used jquery?how to use jquery in dot net applications?please give some examples?
Sreekumar P replied to Lavinia Rayan on 09-Jan-12 06:23 AM
Hi,
jQuery is a coding language that is a branch from JavaScript. jQuery works like JavaScript where its used to help with interaction and effects with your development code

Why jQuery for Development?
The best featuring for jQuery is the effects you can accomplish, with less code than what it would take with JavaScript. Most common jQuery effects are drop down menus, drag and drop elements, animations and form validation. Developers have also connected this with other coding languages like JSP, ASP, PHP and CGI.

Download the latest jQuery library from jQuery.com http://docs.jquery.com/Downloading_jQuery.
Add reference to the jQuery library file in ASPX page / Master page that uses jQuery.


<script src="_scripts/jQuery-1.5.js" type="text/javascript"></script>
<script language="javascript">
$(document).ready(function(){ $("a").click(function(event)
  { alert("Welcome to jQuery"); }); });
</script>


Here is a great article for How to Use Jquery with ASP.NET
http://www.codeproject.com/KB/ajax/AjaxJQuerySample.aspx
Suchit shah replied to Lavinia Rayan on 09-Jan-12 06:31 AM
Jquery is JavaScript Library which is having benifits listed http://jquery.com/ (Cross browser, CSS Compliant, easy dom manipulation)

jQuery is a javascript library that helps developer to write browser compatible and less javascript code. jQuery library is written completely in javascript only. The DOM is mess and its behavior is different in all n-number of browsers. Therefore, in order to create a common layer over the DOM that would handle all weird behaviors of the DOM in every browsers jQuery and other such libraries had evolved. One day will come when, nobody will write javascript code directly to do manipulation, traversal and any other behavior change of DOM. JavaScript will become the machine or library level language and people will use DOJO , Prototype, YUI or jQuery like librarie's utility methods to do DOM manipulation, traversal etc. Because, these libraries saves developer’s time, testing efforts, lines of code and improves their productivity and efficiency of development.

How to use the JQUERY in .net application for that follow below few nice article for that

http://www.codeproject.com/KB/scripting/LearnJQueryByLab.aspx
http://blogs.msdn.com/b/timchen/archive/2009/03/03/why-use-jquery-in-your-asp-net-web-app.aspx
http://www.codeproject.com/KB/ajax/AjaxJQuerySample.aspx
dipa ahuja replied to Lavinia Rayan on 09-Jan-12 06:33 AM

The 3 main advantages of using jQuery are:

  • its light weight when compared to other javascript frameworks
  • it has a wide range of http://plugins.jquery.com/ available for various specific needs
  • it is easier for a designer to learn javascript as it uses familiar CSS syntax. jQuery is http://www.sitepoint.com/article/jquery-javascipt-designers/
To use the jquery you have to download it , and just add the .js file and .css (optional for some controls) . download it from here: http://jqueryui.com/