0

Does anyone know how to convert backend data to a json response using .NET technologies? It'd be nice to have this and use jquery to call some information on the backend.

1 Answer 1

2

The JavaScriptSerializer is commonly used class for serializing objects into JSON strings:

var serializer = new JavaScriptSerializer();
var foo = new Foo
{
    Prop1 = "value 1",
    Prop2 = 123
};

// produces: {"Prop1":"value 1","Prop2":123}
string result = serializer.Serialize(foo);

Json.NET is another third party alternative.

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

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.