Question Displaying a Save Dialog Box

Fogie

New member
Joined
Aug 22, 2016
Messages
2
Programming Experience
3-5
I am working in VB.NET using Visual Web Developer Enterprise 2010 on an XP OS. I need to let the user download a file, but there is no reference to any dialog box or common dialog in the toolbox. I get a syntex error if I try to create one on the fly:

Dim Open_Dialog As New OpenFileDialog()

OpenFileDialog is underlined indicating a syntax error. It is also underlined if I delete the parentheses.

How do I install common dialog on the toolbox or create one at run time?
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,171
Location
Sydney, Australia
Programming Experience
10+
If you're using VWD then you're obviously creating a web application. The OpenFielDialog class is a Windows Forms component, so you don't use it in web apps. The user will be accessing your app in a browser and thus your app can't access their local machine. You would use a FileUpload control or whatever Web Forms provides and then the browser will be responsible for providing the UI to select the file to upload.
 

Fogie

New member
Joined
Aug 22, 2016
Messages
2
Programming Experience
3-5
Thanks loads! I'm using the FileUpload box to get the address on the client computer. Problem solved. :)
 
Top Bottom