I try this method to get data and also i have try jquery . In jquery i call info method
- [WebMethod]
- public static string info(string id) {
- try {
- string result = "";
- Entities er = new Entities();
- List < sp_web_Result > sv = er.sp_web(id).ToList();
- DataTable dt = new DataTable();
- dt.Columns.Add("No", typeof(string));
- dt.Columns.Add("Latitude", typeof(float));
- dt.Columns.Add("Longitude", typeof(float));
- foreach(var c in sv) {
- dt.Rows.Add(c.No, c.Longitude, c.Latitude);
- };
- HttpContext.Current.Session["ID"] = id;
- result = DataSetToJSON(dt);
- return result;
- }
- catch (Exception ex) {
- throw new Exception();
- }
- }
try to pass id through web method in this line data:JSON.stringify(obj.ID),
when i do this there is error on console
Uncaught TypeError: "442".val is not a function
when i remove .val() then this show error
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Tejas TrivediPosted Sep 22, 2016, 7:22 AM
scropio gurlPosted Sep 22, 2016, 7:18 AM
Tejas TrivediPosted Sep 22, 2016, 7:12 AM