giovedì 8 aprile 2010

.NET MVC and Jquery



To understand jquery a good place to start (how to show/hide divs, fade effects, and so on) is http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery and http://visualjquery.com/

When you are planning to build a .NET MVC form which performs insert/edit/delete over a DB, it's very useful the jqgrid plugin. The only "problem" that I found with jqgrid is that it requires data in a json format and, IMHO, this is not very "comfortable".

If you make a google search, you'll find examples of MVC responses which make almost everything by their own.
It would be great if you keep all your javascript code in a proper contentplaceholder of your views:
<asp:ContentPlaceHolder ID="ScriptContent">
your code here
</asp:ContentPlaceHolder>

In the Master Page it must stay empty: ;-)
<asp:ContentPlaceHolder ID="ScriptContent" runat="server">
</asp:ContentPlaceHolder>

There is also the way to use Intellisense for jquery in Microsoft Visual Web Developer! to do this simply refer to the -vsdoc.js file in the head of your MasterPage:
<script src="../../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>

Nessun commento:

Posta un commento