Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

json ajax call in not firing

$
0
0

i have below code but its not calling mention action method when i put break point

 [HttpPost]
        public ActionResult subscribe(string values)
        {
            DataSet  ds = new DataSet ();
            ds = ts.SelectQueryDS ("select * from [TBL_USER] where username="+"'"+   Session["user"] + "'");

            int id= Convert.ToInt32(ds.Tables[0].Rows[0][0]);

            string[] valuesdb = values.Split(',');
            for (int i = 0; i < valuesdb.Length; i++)
            {
                valuesdb[i] = valuesdb[i].Trim();
                ts.IUD("insert into tbl_usergroup (userid,gid)values( " + id + "," + valuesdb[i] + ")");
            }
            DataSet ds1 = new DataSet();
            ds1 = ts.SelectQueryDS("select * from [TBL_USER] where username=" + "'" + Session["user"] + "'");

            int id2 = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            ds1 = ts.SelectQueryDS("select *   FROM [GroupChatSignalR].[dbo].[tbl_usergroup]  as [usergroup]  inner join tbl_group grp  on [usergroup].gid = grp.gid    where [usergroup].[Userid] =" + id2);
              return Json(ds1.Tables[0], JsonRequestBehavior.AllowGet);
        }
$.ajax({
                            url: '/Home/subscribe',
                            type: "POST",
                            data: { values: valueArray.toString() },
                            cache: false,
                            contentType: "application/json; charset=utf-8",
                            dataType: "json",
                            success: function (data) { alert(data); },
                            failure: function (errMsg) {
                                alert(errMsg);
                            }
                        });


Viewing all articles
Browse latest Browse all 5678

Trending Articles



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