Other sections related to the same discussion:
- Visual Studio 2008 - Ways to Start an ASP.NET Web Database Application - General Considerations
- Visual Studio 2008 - Ways to Start an ASP.NET Web Database Application - Par One
DiskCatalog - The Classic Post-Back Way;
- Visual Studio 2008 - Ways to Start an ASP.NET Web Database Application - Part Two
DCatalogAjax - The Microsoft ASP.NET AJAX Way;
- Visual Studio 2008 - Ways to Start an ASP.NET Web Database Application - Part Three
dcJQuery - The jQuery AJAX Way;
- Visual Studio 2008 - Ways to Start an ASP.NET Web Database Application - Part Four
MVC2DCatalog - The MVC2 Framework Way;
Notice: To be able to reproduce and run this sample, you should be sure you read and followed the chapters present in "Visual Studio 2008 - Ways to Start an ASP.NET Web Database Application - General Considerations". Also, you may read the "DCatalogAjax - The Microsoft ASP.NET AJAX Way" section to get a better idea regarding ASP.NET AJAX apps.
The jQuery AJAX (JQ-AJAX) refers to the jQuery AJAX way a web application may work by using the ASP.NET framework (FX).
How jQuery AJAX works ?
However, regarding the VS2008 controls and ASP.NET, this means that the usual "Post-Backs" are replaced by jQuery callbacks. So, all the internal actions of a VS2008 control may be avoided in order to better manage the jQuery results. For example, an ASP DATA GridView will loose the sort, select, edit, delete, paging actions and they should be redesigned with jQuery. This happens because jQuery is not an VS2008 integrated development medium and VS2008 manages in a different way the callbacks to the server.
The jQuery AJAX Way sample
In addition, now there is presented a switch section between "Browse Disks" and "Search Disks" on the starting "Default.aspx" page. The "Search Disks" is not implemented yet, its purpose is to demonstrate jQuery capability of "$.load()" function. The behaviour of this switch is revealed by "/js/Default.js" file which allows the AJAX loading of the "disks_view.aspx" and "disks_search.aspx" pages, by using jQuery $.load() when the user clicks the "Browse Disks" or "Search Disks" buttons.
You may find important design information in "Default.aspx", "disks_view.aspx", "disk_items_view.aspx", "disk_subitems_view.aspx", "disk_subitem_details.aspx" and in their coresponding "code behind" files.
Here is an archive with the source of this sample:
Notice: when I started to work at this sample, I named the Solution Project as "MasterDetailJQuery", and then I refered at it as "dcJQuery".
Below there is an image with dcJQuery app working:
VS2008 has a convention in which if the ASPX file has a user defined name, then the "code behind" will be named [ASPX_filename].cs. You may find also a [ASPX_filename].designer.cs file that is updated whenever you add a control to the ASPX page from the "design" mode. If you want to internally modify the control added in "design" mode, then you shoul delete its declaration from [ASPX_filename].designer.cs and move it to [ASPX_filename].cs, thus having full access to that control and the ability to extend the capabilities of it.
Even if jQuery is known as doing fast AJAX callbacks, this is not a good approach from the VS2008 point of view. You may not use the power of the ASP controls, because they are managed in a different way and you will have to write jQuery events for all the internal events of these controls (for instance the ASP DATA GridView internal "sort", "select", aso events). Luckily, you may use jQuery complex designed controls.