• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class JsonExtensionsWeb

JSON Extensions based on the JavaScript Serializer in System.web.

Inheritance
System.Object
JsonExtensionsWeb
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public static class JsonExtensionsWeb : object

Methods

| Improve this Doc View Source

FromJson(String, Type)

Extension method to string that deserializes a JSON string into a specific type. Note that the type specified must be serializable.

Declaration
public static object FromJson(this string json, Type type)
Parameters
Type Name Description
System.String json

A JSON string.

Type type

The type to deserialize the JSON into.

Returns
Type Description
System.Object

The deserialized value.

| Improve this Doc View Source

FromJson<TType>(String)

Extension method to string that deserializes a JSON string into a specific type. Note that the type specified must be serializable.

Declaration
public static TType FromJson<TType>(this string json)
Parameters
Type Name Description
System.String json

A JSON string.

Returns
Type Description
TType

The deserialized value.

Type Parameters
Name Description
TType

The type to deserialize the JSON into.

| Improve this Doc View Source

FromJsonString(String, Type)

Deserializes a JSON string into a specific type. Note that the type specified must be serializable.

Declaration
public static object FromJsonString(string json, Type type)
Parameters
Type Name Description
System.String json

A JSON string.

Type type

The type to deserialize the JSON into.

Returns
Type Description
System.Object

The deserialized value.

| Improve this Doc View Source

ToJson(Object)

Extension method on object that serializes the value to JSON. Note the type must be marked Serializable or include a DataContract attribute.

Declaration
public static string ToJson(this object value)
Parameters
Type Name Description
System.Object value

The value to serialize.

Returns
Type Description
System.String

The JSON string.

| Improve this Doc View Source

ToJsonString(Object)

Serializes a type to JSON. Note the type must be marked Serializable or include a DataContract attribute.

Declaration
public static string ToJsonString(object value)
Parameters
Type Name Description
System.Object value

The value to serialize.

Returns
Type Description
System.String

The JSON string.

  • View Source
Back to top by the community, for the community... #DNNCMS