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.
Unfortunately, activation email could not send to your email. Please try again.

Loading diagram from web site files

Thread ID:

Created:

Updated:

Platform:

Replies:

116268 May 6,2014 05:11 PM May 7,2014 04:45 AM ASP.NET MVC (Classic) 2
loading
Tags: Diagram
Jeff
Asked On May 6, 2014 05:11 PM

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:

/Content/diagram.xml

~/Content/diagram.xml

http://localhost:9999/Content/diagram.xml

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.


Jeff
Replied On May 6, 2014 06:17 PM

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!


Shyam G [Syncfusion]
Replied On May 7, 2014 04:45 AM

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

Regards,

Shyam G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;