I am populating a grid in JavaScript by calling a webmethod(return json dataset. Dataset contains datatable). Grid is successfully filling when there is less than 100 rows. If there is more rows , it is not returning to Success method of ajax call.

Already tested with breakpoint, break point is coming till return statement in webmethod.

AJAX call:

$.ajax({ type: "POST", url: 'CopyofItemInquiries.aspx/GetUPCDetails', data: JSON.stringify({ UPCCollection: UPCCol, UPCLike: UPCLike, UPCRangeFrom: RangeFrom, UPCRangeTo: RangeTo, Filter: FilterVal }), contentType: "application/json; charset=utf-8", dataType: "json", success: function (Result) { var myjsongrid = $.parseJSON(Result.d); } });

Web method:

[WebMethod] [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json, UriTemplate = "json")] public static string GetUPCDetails(List UPCCollection, String UPCLike, String UPCRangeFrom, String UPCRangeTo,String Filter) { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); Dictionary dic_SaveUser = new Dictionary();

    var xml = new XElement("ROOT", UPCCollection.Select(x => new XElement("UPCLIST",
                                            new XAttribute("UPC", x))));

    dic_SaveUser.Add("@User_ID", HttpContext.Current.Session["FT_username"]);

    DataSet dt_DataSet = new DataSet("dt_DataSet");
    dt_DataSet = DbAccessModule.getDataTableStoredProcedureForMultipleResultSet((SqlConnection)HttpContext.Current.Session["lt_AppConn"], "sp_UPC_Details", dic_SaveUser);

    HttpContext.Current.Session["VendorDetails"] = dt_DataSet.Tables[1];

    return JsonConvert.SerializeObject(dt_DataSet);

0 Answers