Skip to main content

ASPxDiagram.Export() Method

Exports the diagram data in JSON format.

Namespace: DevExpress.Web.ASPxDiagram

Assembly: DevExpress.Web.ASPxDiagram.v23.1.dll

NuGet Package: DevExpress.Web


public string Export()


Type Description

The diagram data in JSON format.


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

The control saves the diagram’s data in its own text format. The resulting JSON object contains measurements in twips, regardless of the Units or ViewUnits property values. Do not modify this JSON object because modified data can load incorrectly.

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))) {
protected void btnLoad_Click(object sender, EventArgs e) {

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

See Also