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

how to display a Save Dialogbox

Hi there,
i would like to know how can i open a SaveDialog in ASP.NET to save diagram local, not on the server
for saving diagram at server, i used

string AppPath = Server.MapPath(string.Empty);
DiagramWebControl1.SaveBinary(AppPath + @"\Test.xml");

Best Regards
Hayssam


3 Replies

AA Amsath Ali M Syncfusion Team April 5, 2013 12:24 PM UTC

Hi Hayssam,

 

Thanks for using Syncfusion products.

 

Currently, it is not possible to save diagram in local using SaveFileDialog box because the SaveFileDialog belongs to the browser and is inaccessible to ASP.NET code for security reasons. However, you can save the diagram locally in ASP.NET temporary directory. Please refer the below code snippet to save the diagram in ASP.NET temporary directory.

 

For more information regarding the usage of saveFileDialog in ASP.NET, please visit the below links:

http://forums.asp.net/t/1178720.aspx/1

http://forums.asp.net/t/1698194.aspx/1

http://stackoverflow.com/questions/13207716/how-to-show-savefiledialog

 

Here is the code:

[C#]

DiagramWebControl1.SaveBinaryDocument(Path.GetTempPath() + "Diagram.edd");

 

Here is the sample:

 http://www.syncfusion.com/downloads/Support/DirectTrac/General/F107990-40125644.zip

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M



HH Hayssam Hassan May 15, 2013 11:35 AM UTC

Hi Amsath,
thanks for your update,
i have some problems with my window-controller, after clicking the save button the window should close, but it doesnt. i dont know whats is wrong with code.

Hier is my code
protected void Save_btn_click(object sender, EventArgs e)
    {  
        // Saving diagram. 
        string AppPath = Server.MapPath(string.Empty);
        DiagramWebControl1.SaveBinaryDocument(AppPath + "\\" + tbSaveFileName.Text);
      
        // Saving diagram locally.
        string filepath = AppPath + "\\" + tbSaveFileName.Text;
        HttpContext.Current.Response.ContentType = "application/octet-stream";
         HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" +                                                                                      tbSaveFileName.Text);
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.WriteFile(filepath);
        HttpContext.Current.Response.End();
}



AA Amsath Ali M Syncfusion Team May 20, 2013 01:04 PM UTC

Hi Hayssam,

 

Thanks for your update.

 

Since you have asked the same query  in the forum 108856, we have updated our response for your query in that forum (108856). Could you please refer that forum for better follow up?

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M


Loader.
Live Chat Icon For mobile
Up arrow icon