Quantcast
Viewing all articles
Browse latest Browse all 82129

Jquery Datatables with asp.net asmx web services

Hi,

I know there are lot of post already there related to this but i am newbie who tried help from those post but in vain.
I have asmx web which i am able to call through my normal jquery ajax call.

this is how my service looks like.

 [WebMethod]
        public List<DisplayPackage> GetExpiryRules(string culture, string affiliateId, string selectedPackages, string intervals)
        {
            CatalogBl objCatalogBl = new CatalogBl();
            AffiliateInfo affinfo = objCatalogBl.GetAffiliate(int.Parse(affiliateId), true);

            string accurevUserName = ConfigurationManager.AppSettings["AccurevUserName"];
            string sourceStream = ConfigurationManager.AppSettings["AccurevSourceStream"];
            string affiliate = affinfo.AffiliateCode;

            Boolean l_IsExists = FileExistanceValidator.DoesThisFileExist(culture, affiliate, affiliateId);

and this is how how my client code looks like
 $('#getExpiryRules').live('click', function () {
        $('#expiryRulesDataTable').dataTable({
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": '../Services/WebServices.asmx/GetExpiryRules',
            "sAjaxDataProp": "d", "sPaginationType": "full_numbers", "bDestroy": true, "bAutoWidth": false,
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "culture": "en-us", "affiliateId": 0, "selectedPackages": "selectedPackages", "intervals": "intervals" });
                $.ajax({
                    type: "POST",
                    data: aoData,
                    dataType: "json",
                    url: sSource,
                    contentType: "application/json; charset=utf-8",
                    success: success
                });
                function success(json) {
                    fnCallback(json);
                }
            }
        });

1. i am using jquery-1.6.4.min.js version.
2. the response from the service is not json serialised yet (will do it after atleast services get hit)
3. what am i doing wrong here
4. the error that i get on the firefox console is {"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}

Any help or guidance in the right direction would be much appreciated.

Viewing all articles
Browse latest Browse all 82129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>