Open file dialog in ASP.NET application!

L

Lars Grøtteland

Hello!

Why can't I use the OpenFileDialog in a ASP.NETs ascx page? The class
inherits from the System.Windows.Forms, but when I put that into the ascx
file, it comes up with an compile error.

The type or namespace name 'Windows' does not exist in the class or
namespace 'System' (are you missing an assembly reference?)


Anyone used openfile dialog in asp.net? Using vs2003 and ASP.NET 1.1

- Lars
 
N

Nicholas Paldino [.NET/C# MVP]

Lars,

An ASP .NET page doesn't inherit from System.Windows.Forms. Even if you
did have a class that did, you couldn't use it. The reason for this is that
the processing takes place on the server side, and if you were able to throw
up a dialog, no one would be able to see it (it would come up on the server
side, with most likely no session, and never be responded to).

Rather, if you want to upload a file, you will have to use a file input
element (<input type:file>, I believe) to specify a textbox with a browse
button.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top