Windows Application Dataview using JSON [Resolved]

Posted by Manicse under ASP.NET MVC on 11/10/2016 | Points: 10 | Views : 1534 | Status : [Member] | Replies : 1
Hi,

Working with the Dataview which get the values from JSON and need to bind the data in the Datagrid.
The tables in the Datagrid as created in Models. Now need to map this JSON data to the Datagrid.

HttpResponseMessage Response = await client.PostAsync("http://www.google.com", content);
int statusCode = (int)Response.StatusCode;
string results = await Response.Content.ReadAsStringAsync();
MessageBox.Show(results);


I have DE serialize the object and passing as the JSON object in controller.

var tabs= JsonConvert.DeserializeObject<List<JsonResult>>(input);


The JSON Object returning Null object when its reaching the View part. It has values in Controller while returning.

Mani.R


Responses

Posted by: Rajnilari2015 on: 11/10/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
Try this

HttpClient client = new HttpClient();

HttpContent contentPost = new StringContent(content, Encoding.UTF8,"application/json");

HttpResponseMessage Response = await client.PostAsync(new Uri("http://www.google.com"), contentPost).ContinueWith(
(postTask) => postTask.Result.EnsureSuccessStatusCode());

..............
................

--
Thanks & Regards,
RNA Team

Manicse, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response