- Home
- Forum
- ASP.NET Web Forms (Classic)
- how to display a Save Dialogbox
how to display a Save Dialogbox
- Mar 27, 2013 04:44 PM UTC
- May 20, 2013 01:04 PM UTC
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
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
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();
}
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
- 3 Replies
- 2 Participants
-
HH Hayssam Hassan
- Mar 27, 2013 04:44 PM UTC
- May 20, 2013 01:04 PM UTC