Json.Decode Method (String)

Converts data in JavaScript Object Notation (JSON) format into a data object.

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

public static Object Decode(
	string value
)

Parameters

value
Type: System.String
The JSON-encoded string to convert.

Return Value

Type: System.Object
The JSON-encoded data converted to a data object.

Call the Decode method to decode data that was encoded into JSON format earlier by using the Encode(Object) method. You can use this method to convert JSON-encoded data into a data object that you can work with in ASP.NET Razor code. For example, you can use a foreach block to loop through all of the Product objects in a set of data and update them in a database.

Show: