mardi 14 juillet 2015

Manual Parsing of JSON Data from MVC3 Request

My Ajax Sends Json as

{"deleteids":"8","dtldels":[]}

I have a class where i am trying to decipher the values from request object in to the class properties as follow

 get {
        var x = HttpContext.Current.Request.QueryString["deleteids"]; // null here
        var y = HttpContext.Current.Request.Form["deleteids"]; // null here
        return  HttpUtility.UrlDecode(HttpContext.Current.Request["deleteids"]); // null here
  }

Both x, y and the return all return null. Why is that ? And how do i get the values correctly into my property.

Thanks.

Aucun commentaire:

Enregistrer un commentaire