We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Loading diagram from web site files

For development purposes, I would like to store a diagram.xml file among my web site files, then load the diagram using DiagramBuilder.  I have successfully loaded a file from the local file system in the %Temp% location, but can't seem to get it to work for a file stored in the web site itself.  I have tried passing the following strings to the Load method, all of which result in an empty DiagramModel:




By the way, if I enter the fully qualified URL into a browser, I can see the XML stored in the file.

Is what I want to do possible?  If so, can anyone help me with getting the right syntax?  Thanks for your help.

2 Replies

JE Jeff May 6, 2014 10:17 PM UTC

I was able to answer this question myself.  Here's what I needed:

   HttpContextWrapper context = new HttpContextWrapper(System.Web.HttpContext.Current);

   var filePath = context.Server.MapPath("~/Content/diagram.xml");

    diagramView.Model.Load(filePath); // diagramView was previously assigned

Guess I should have looked a little more diligently before posting!

SG Shyam G Syncfusion Team May 7, 2014 08:45 AM UTC

Hi Jeff,

Sorry for the delay in getting back to you,

We are glad that your issue got resolved.

Could you please let us know whether you are in need of any other assistance from us? Please get back to us if you need further assistance


Shyam G

Live Chat Icon For mobile
Up arrow icon