Hi asp777,
The conversion is ok. You are checking JObject insted of string.
So you are getting the double brackets.
To check the proper json check with to string method.
protected void Page_Load(object sender, EventArgs e)
{
var data = "{\"publisResult\":[{\"key\":{\"SearchTerm\":\"flower\"},\"data\":[{\"PublisImgUrl\":\"https://abc.png\",\"Name\":\"Jhon\",\"Title\":\"gardenflowershop\",\"Description\":\"OnlineFlowerShopsindeliveryHongKong\"},{\"PublisImgUrl\":\"garden.com\",\"Name\":\"JhonCena\",\"Title\":\"weddings\",\"Description\":\"WeddingFlowersandGifts|1-800-FLOWERS.COM\"}]},{\"key\":{\"SearchTerm\":\"Pizza\"},\"data\":[{\"PublisImgUrl\":\"https://abc.png\",\"Name\":\"Harry\",\"Title\":\"benny-drinnon.com\",\"Description\":\"TAMELAC.TODD-Home|TamelaTodd\"},{\"PublisImgUrl\":\"gardenflowershop\",\"Name\":\"Roma\",\"Title\":\"benny-drinnon.blogspot\",\"Description\":\"MichelleMorganTalksThelma\"}]}]}";
Newtonsoft.Json.Linq.JObject json = Newtonsoft.Json.Linq.JObject.Parse(data);
string jsonData = json.ToString();
}
This will generate proper json as below.
{
"publisResult": [
{
"key": {
"SearchTerm": "flower"
},
"data": [
{
"PublisImgUrl": "https://abc.png",
"Name": "Jhon",
"Title": "gardenflowershop",
"Description": "OnlineFlowerShopsindeliveryHongKong"
},
{
"PublisImgUrl": "garden.com",
"Name": "JhonCena",
"Title": "weddings",
"Description": "WeddingFlowersandGifts|1-800-FLOWERS.COM"
}
]
},
{
"key": {
"SearchTerm": "Pizza"
},
"data": [
{
"PublisImgUrl": "https://abc.png",
"Name": "Harry",
"Title": "benny-drinnon.com",
"Description": "TAMELAC.TODD-Home|TamelaTodd"
},
{
"PublisImgUrl": "gardenflowershop",
"Name": "Roma",
"Title": "benny-drinnon.blogspot",
"Description": "MichelleMorganTalksThelma"
}
]
}
]
}