|
-
Dec 4th, 2008, 09:33 AM
#1
Thread Starter
Fanatic Member
[2005] How to get OpenFileDialog in toolbox?
I want to use OpenFileDialog on my Website, and add it to the toolbox. How can I do this?
What I have tried so far:
1. Added reference, chose System.Windows.Forms
2. Went into source view, typed, <asp penfiledialog (it couldn't find it)
3. 'Show All' in toolbox, OpenFileDialog was under 'Dialogs' but it was greyed out.
-
Dec 4th, 2008, 09:54 AM
#2
Re: [2005] How to get OpenFileDialog in toolbox?
What? You can't do this. If you add the OpenFileDialog to your website then it'll just pop-up on the server itself and the users won't see it.
If you want them to upload files then use the FileUpload ASP.Net control.
-
Dec 4th, 2008, 03:44 PM
#3
Thread Starter
Fanatic Member
Re: [2005] How to get OpenFileDialog in toolbox?
I don't want them to upload files, I want a file to be processed, basically a simple file dialog where they choose the file and it pops it into a textbox on screen so the code can grab it. The users will be looking on their computers for the file. Right now I'm using an HTML control that does this, I'd like to use an ASP.NET control.
I tried using FileUpload this way, but it didn't seem to work - although the textbox displayed the full path, the filename on the control was looking in C:\Windows\System32 ?
-
Dec 5th, 2008, 12:25 AM
#4
Re: [2005] How to get OpenFileDialog in toolbox?
There is no other way to do it. You either have to use the Html version of an input field with type of file and handling the posting yourself, or you let ASP.Net do the work with the FileUpload control. Here is a tutorial on using the FileUpload control: http://www.c-sharpcorner.com/UploadFile/......0ee6b
-
Dec 8th, 2008, 09:04 AM
#5
Hyperactive Member
Re: [2005] How to get OpenFileDialog in toolbox?
hi,
There is no such a dialog box in asp.net, u can use FileUpload control instead
or just navigate to
http://www.daniweb.com/forums/thread55566.html
thankx
koolprasad2003
MCP, MCTS, Microsoft MVP [Asp.Net/IIS]
For more .NET development tips visit .NET Tips
If the post is useful then please  Rate it
-
Dec 8th, 2008, 04:51 PM
#6
Re: [2005] How to get OpenFileDialog in toolbox?
Remember that the FileUpload control is nothing but the file input control in HTML.
You cannot process a file on your page unless it is uploaded. Look at the FileUploadControl1.HasFile property, for example, to see if the user has uploaded a file. You can then process that file in your codebehind.
The 'filename' you are getting in the codebehind (I assume) is what the browser sends to you after the user has submitted the form with a file. ASP.NET is a server-side technology so you cannot do processing on the 'client side' without using something like JavaScript.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|