In Silverlight you have to save a file using the save file dialog.
You can only open this dialog from a user event aka a button click
I’m returning the data of a file from a web service call asynchronously
How do i save this to file?
If i ask them before the service call i can’t use the stream after the data comes back.
If i ask them after i can’t open the save file dialogue.
It’s a bit of chicken and the egg situation.
Thanks.
update
i want to be able to save the users computer where they spectifiy not the silverlight isolated storage.
Open a
SaveFileDialogfrom a user event, then keep a reference to this dialog around. Make your web service call, then in the handler for this call, call theOpenFile()method on theSaveFileDialog. Use the stream returned by this method to write to your file.If you’d like an even more detailed example that uses this same technique, see here.