0
{"pometek.net":{"status":"available","classkey":"dotnet"},"pometek.com":{"status":"available","classkey":"domcno"}} 

I want to dispense this in table format. Need help.

1
  • You can deserialize it to IDictionary<string, string>, take a look at this SO question Commented Nov 1, 2012 at 10:24

2 Answers 2

2

You can use Json.NET to deserialize the json object into a C# class, and then map that class to a table format in asp.net

Sign up to request clarification or add additional context in comments.

Comments

1

You shouldn't need a third-party library; the out-of-the-box JavaScriptSerializer can handle this.

class Item {
    public string status { get; set; }
    public string classkey { get; set; }
}

var jss = new System.Web.Script.Serialization.JavaScriptSerializer();
var input = "{\"pometek.net\":{\"status\":\"available\",\"classkey\":\"dotnet\"},\"pometek.com\":{\"status\":\"available\",\"classkey\":\"domcno\"}}";
var results = jss.Deserialize<Dictionary<string, Item>(input);
var query = results["pometek.net"].status; // = "available"

Displaying this as a table is a separate step.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.