views:

23

answers:

2

Hello, I have a web application which consists of many aspx pages ... one of them shows a grid with rows that can be exported to a file via button click. This works fine. Now I want to have that feature which allows a user to access an external link to this page (or another) and to export to a file and download. I dont need any information on the page, just the file download. How could I do this also including security features like encryption?

Thanks :)

+1  A: 

The easiest way to do this is simply implement an HttpHandler that contains the logic to create that file and write it to the Response stream.

There are lots of examples of how to do this on the web that I won't repeat in this question. Just do a Google search for "Download File HttpHandler" and you should be golden.

One of the search results: http://www.c-sharpcorner.com/UploadFile/jhblankenship/DownloadingFromMemStreamHttp11262005061852AM/DownloadingFromMemStreamHttp.aspx

Josh
A: 

What you're going to have to do is when the gridview shows the correct rows to provide a 'unique link' which will be your website URL with url variables at the end. When the page loads it can check these variables and then use the database to look up the correct data etc.

Encryption in transit will be done via HTTPS (SSL), and to secure otherwise you would require a login to view the gridview / file.

m.edmondson