Imports System.IO
Posted: 10/21/2005 3:13:16 PM
By: Comfortably Anonymous
Times Read: 1,707
0 Dislikes: 0
Topic: Programming: Web Applications
Parent Message
For the above sub to work, you need to have 'Imports System.IO' at the top of the code.

Also, I should have said that this not the best thing to use from Form_Load - if you do it that way, the user ends up with a blank browser screen after closing the app, with no flow-thru on what to do next.

The way I use it is to have a screen with a 'Download' button and a link to somewhere (Back to the main page or wherever). The Download button calls the ForceFileDownload code, and then when the app is closed, there is still the link to on the browser page. Makes it cleaner for the user.

Your choice, do what you will...
Rating: (You must be logged in to vote)