Skip to main content

ASPxDiagram.Import(String) Method

Imports the diagram data.

Namespace: DevExpress.Web.ASPxDiagram

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

NuGet Package: DevExpress.Web


public void Import(
    string data


Name Type Description
data String

The diagram data in JSON format.


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

Use the Import 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.


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