How to read JSON data from ashx file

CrazyPrince

New Member
from my client side i send json data to data.ashx file but i am not being able to read data from ProcessRequest method of ashx file. just can not understand why i am getting nullthis way i am sending data from client side to ashx file\[code\] var FeedCrd = {}; FeedCrd["Name"] = $("input[id*='txtName']").val(); FeedCrd["Subject"] = $("input[id*='txtSubject']").val(); FeedCrd["Email"] = $("input[id*='txtFEmail']").val(); FeedCrd["Details"] = $("textarea[id*='txtDetails']").val(); $.ajax({ type: "POST", url: urlToHandler + "?ac=send", data: JSON.stringify(FeedCrd), contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data =http://stackoverflow.com/questions/12584785/="SUCCESS"); { // } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); } });\[/code\]here is my ashx file code for ProcessRequest\[code\] public void ProcessRequest(HttpContext context) { string outputToReturn = ""; context.Response.ContentType = "text/html"; if (context.Request.QueryString["ac"] == "send") { string sName = context.Request["Name"]; string sSubject = context.Request["Subject"]; outputToReturn = "SUCCESS"; } context.Response.Write(outputToReturn); }\[/code\]i have also seen how data is going to server side using firebig. here is the data{"Name":"cvv","Subject":"fdsfd","Email":"[email protected]","Details":"wow"}so please help me how to read data from ashx file when json send from client side. please tell me where i made mistake. please guide me. thanks
 
Back
Top