All docs
V20.2
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ASPxDiagram.Export() Method

Exports the diagram data in JSON format.

Namespace: DevExpress.Web.ASPxDiagram

Assembly: DevExpress.Web.ASPxDiagram.v20.2.dll

Declaration

public string Export()
Public Function Export As String

Returns

Type Description
String

The diagram data in JSON format.

Remarks

The Export method allows you to save information about the diagram's layout, appearance, and shape positions.

Use the Import(String) method to load this data to the ASPxDiagram control.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px"/>
<dx:ASPxButton ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"/>
<dx:ASPxButton ID="btnLoad" runat="server" Text="Load" OnClick="btnLoad_Click" />
using System.IO;
...
protected void btnSave_Click(object sender, EventArgs e) {
    using (StreamWriter diagramData = File.CreateText(MapPath(diagramDataPath))) {
        diagramData.WriteLine(Diagram.Export());
    }
}
protected void btnLoad_Click(object sender, EventArgs e) {
    Diagram.Import(File.ReadAllText(MapPath(diagramDataPath)));
}

Use the ASPxClientDiagram.Export and ASPxClientDiagram.Import methods to save and load the diagram data on the client side.

NOTE

The ASPxDiagram stores an opened diagram's data in its own text format. Do not modify the data the Export method returns because a modified document can be loaded incorrectly.

See Also