CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

How to invoke a "File Download" Dialog Box in a winform application?

rated by 0 users
This post has 3 Replies | 1 Follower

Not Ranked
Posts 40
yimiqi Posted: Mon, Sep 24 2007 10:00 PM

This question probably doesn't belong here but I googled it and didn't find any luck on the topic. I thought I'd try here since there are many computer gurus is this forum.

I have a winform application and implemented an export button, when the user clicks the export button, I'd like to invoke a standard "File Download" Dialog Box like in IE that will allow user to open the .csv file in the browser when Open button is clicked and saves the .csv file when Save button is clicked.  This is all straightforward if it was a web application.  But as for a windows application, there is only an Open File Dialog Box and a Save File Dialog Box. 

My question is:

Is it possible to invoke the "File Download" Dialog Box like in IE in a winform application?

Or do I have to write my own?

Thank you for any inputs.

 

Top 10 Contributor
Posts 3,922
Andy replied on Tue, Sep 25 2007 7:05 AM
You'd probably have to create your own, because that's really a web paradime, and counter-intiutive on a winforms app.  I'd be very suprised to see such a dialog from a winforms app, and I may even think it was trying to launch a virus or something.   No matter what you're doing to have write a file to disk (unless your app will also can an http server or use IIS), so I'd go the typical Save As dialog result. 
Not Ranked
Posts 40
yimiqi replied on Tue, Sep 25 2007 9:07 PM

Thanks for the reply.  Now I see why you thought it sounded like virus activity - I called it a “file download” that I wanted to implement.

What I really want to implement is a ’save as’ dialog with an additional ‘open’ button… similar to the I.E. ‘file download’ dialog.

Anyways, I've moved forward on this issue. 

Thank you.

Top 10 Contributor
Posts 3,922
Andy replied on Wed, Sep 26 2007 7:00 AM
Ahh, you orginally said "invoke the dialog," so I thought you were trying to get IE involved somehow.  As I'm sure you figured out, you'll need to roll your own.
Page 1 of 1 (4 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems