Hi Charaka,
When we set the mode as data in the diagram client side API exportDiagram method, it returns base64data and you can send that data to the server side from the client side using AJAX. In the server side, you can generate an image from that data and you can save that base64data to an database. Please refer to the code example and help documentation below.
Code example:
function save() {
var diagram = $("#Diagram2").ejDiagram("instance");
//get the base64data
var image = diagram.exportDiagram({ mode: "data"});
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Data.aspx/save",
dataType: "json",
data: "{'base64data': '" + image + "'}",
success: function (Jsonstring) {
alert("Success");
return true;
},
});
}
[WebMethod]
public static void save(string base64data)
{
//get the base64data and save it to database
string image = base64data;
//Do the code to process it as an image
}
Regards,
Shyam G