Results 1 to 6 of 6

Thread: [2005] How to get OpenFileDialog in toolbox?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2005
    Posts
    625

    [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, <asppenfiledialog (it couldn't find it)

    3. 'Show All' in toolbox, OpenFileDialog was under 'Dialogs' but it was greyed out.

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2005
    Posts
    625

    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 ?

  4. #4
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  5. #5
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Talking 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

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width