Click here to Skip to main content
15,886,519 members
Articles / Web Development / ASP.NET

AJAX based CRUD tables using ASP.NET MVC 3 and jTable jQuery plug-in

Rate me:
Please Sign up or sign in to vote.
4.95/5 (256 votes)
10 Feb 2013MIT19 min read 4.9M   55.5K   575  
Creating AJAX based CRUD tables using ASP.NET MVC 3 and the jTable jQuery plug-in.
/* 
ASP.NET WEB FORMS PAGE METHODS EXTENSION FOR JTABLE
http://www.jtable.org
---------------------------------------------------------------------------
Copyright (C) 2011 by Halil �brahim Kalkan (http://www.halilibrahimkalkan.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
(function(c){c.extend(!0,c.hik.jtable.prototype,{_performAjaxCall:function(b,a,d,g,e){var f=this;null==a||void 0==a?a={}:"string"==typeof a&&(a=f._convertQueryStringToObject(a));var h=b.indexOf("?");-1<h&&c.extend(a,f._convertQueryStringToObject(b.substring(h+1)));a=JSON.stringify(a);c.ajax({url:b,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:a,async:d,success:function(a){a=f._normalizeJSONReturnData(a);g(a)},error:function(){e()}})},_submitFormUsingAjax:function(b,
a,d,g){var e=this,a={record:e._convertQueryStringToObject(a)},f=b.indexOf("?");-1<f&&c.extend(a,e._convertQueryStringToObject(b.substring(f+1)));a=JSON.stringify(a);c.ajax({url:b,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:a,success:function(a){a=e._normalizeJSONReturnData(a);d(a)},error:function(){g()}})},_convertQueryStringToObject:function(b){for(var a={},d,c=/\+/g,e=/([^&=]+)=?([^&]*)/g;d=e.exec(b);)a[decodeURIComponent(d[1].replace(c," "))]=decodeURIComponent(d[2].replace(c,
" "));return a},_normalizeJSONReturnData:function(b){return b.hasOwnProperty("d")?b.d:b}})})(jQuery);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Founder Volosoft
Turkey Turkey
I have started programming at 14 years old using Pascal as hobby. Then I interested in web development (HTML, JavaScript, ASP...) before university.

I graduated from Sakarya University Computer Engineering. At university, I learned C++, Visual Basic.NET, C#, ASP.NET and Java. I partly implemented ARP, IP and TCP protocols in Java as my final term project.

Now, I am working on Windows and web based software development mostly using Microsoft technologies in my own company.

My open source projects:

* ABP Framework: https://abp.io
* jTable: http://jtable.org
* Others: https://github.com/hikalkan

My personal web site:

https://halilibrahimkalkan.com

Comments and Discussions