views:

164

answers:

1

I have a Silverlight application that implements some basic CRUD operations on a fairly flat data set. The application loads all the data onto the client to allow for quick editing (this is a fairly small data set no more that a couple K). I would like to allow them to download the file as a CSV so they can edit the data locally.

I know i can set up a HyperLink button to a URL on my webserver and then server the data dynamically using a custom server handler. But this seems kind of roundabout to me because the all the data is already all on the Client's machine (because the Silverlight application loaded it).

So i was wondering if there was a way to prompt the user for a file download and then dynamically generate the file download stream from Silverlight?

+3  A: 

You should look at the SaveFileDialog. It allows you to prompt the user to pick a spot to save the file, and then you have access to the file through the SaveFileDialog.OpenFile method.

Lasse V. Karlsen
thanks! I guess my google-fu is off today. This is exactly what i was looking for.
luke