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.

how to display a Save Dialogbox

Thread ID:

Created:

Updated:

Platform:

Replies:

107990 Mar 27,2013 12:44 PM May 20,2013 09:04 AM ASP.NET Web Forms (Classic) 3
loading
Tags: DiagramWebControl
Hayssam Hassan
Asked On March 27, 2013 12:44 PM

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


Amsath Ali M [Syncfusion]
Replied On April 5, 2013 08:24 AM

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


Hayssam Hassan
Replied On May 15, 2013 07:35 AM

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();
}


Amsath Ali M [Syncfusion]
Replied On May 20, 2013 09:04 AM

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


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.

;