Ensure Appearance of Open/Save Dialog On File Download from Web Page (ASP.NET)

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Intermediate
Author:
Intelligent Solutions Inc.

Version Compatibility: ASP.NET

More information:
Many file types, such as MS Word files, .pdf files automatically open in the client's browser when they are downloaded. To override this behavior and display the save/open dialog, you can use this ASP.NET code. Demo usage is included.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: