Prompt user with OpenFile dialog

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Prompt user with OpenFile dialog

    Hi All,

    I am trying to replicate the functionality of the HTML FileField control
    (<INPUT type="file">). It does everything I need but for one thing: I
    can't programmatically set the value of the FileField control - all the
    reading I have done says that it is impossible for security reasons.

    So, I want to use a standard Server controls: a TextBox control and a Button
    control, and replicate the functionality of the FileField HTML control.
    When the user clicks a "Browse" button, s/he should be presented with a the
    standard Windows OpenFile dialogue box, and when the user selects the file,
    the full path (including file name) should be plonked into the TextBox.
    This way, I can programmatically set the text property of the TextBox.

    Any help greatly appreciated.

    Cheers,

    Mr Gordonz



    Mr Gordonz Guest

  2. Similar Questions and Discussions

    1. Shared Object - Prompt Data Permissions Dialog
      Hello, I'm creating a small app to run from CD-Rom/local installation that will use multiple shared objects for data storage. To ensure proper...
    2. Prompt User From a pgplsql Function
      Greetings List, I am working on converting a large set of code from a commercial 4gl known as Progress to plpgsql. This code defines a rating...
    3. prompt user to save changes in datagrid editmode when they try to navigate away from page...how do you do that?
      Hello, I have a custom datagrid control that works great. But I was thinking about adding some functionality to it. Currently, I use the...
    4. prompt to save changes in datagrid in editmode if user tries to navigate away
      Hello, I have a custom datagrid control that works great. But I was thinking about adding some functionality to it. Currently, I use the...
    5. is there a openfile-dialog to open multiple files?
      Hi, I just tried the "FileXtra4". Its cool, but I couldnt find anything to open several Files at once. I need to open a bunch of user-selected...
  3. #2

    Default Re: Prompt user with OpenFile dialog

    Hi Carl,

    I tried that, and it doesn't work. Apparently, this particular control was
    designed to NEVER allow its value to be set programmatically. I gather it
    was seen as a potential security vulnerability, and so the value property
    can't be set programmatically even when it is run as a server control.

    Cheers,

    MG



    "Carl Howarth" <carl.howarth@m-s-solutions.co.uk> wrote in message
    news:%23eYN5zCXDHA.2484@TK2MSFTNGP09.phx.gbl...
    > If you right click on the control from within vs.net, you will be able to
    > set it to runat server, this will declare it in the backend code thus you
    > will be able to set properties etc.
    >
    > Carl
    >
    > "Mr Gordonz" <paul@mobius.net.au> wrote in message
    > news:ukkP7pCXDHA.3268@tk2msftngp13.phx.gbl...
    > > Hi All,
    > >
    > > I am trying to replicate the functionality of the HTML FileField control
    > > (<INPUT type="file">). It does everything I need but for one thing: I
    > > can't programmatically set the value of the FileField control - all the
    > > reading I have done says that it is impossible for security reasons.
    > >
    > > So, I want to use a standard Server controls: a TextBox control and a
    > Button
    > > control, and replicate the functionality of the FileField HTML control.
    > > When the user clicks a "Browse" button, s/he should be presented with a
    > the
    > > standard Windows OpenFile dialogue box, and when the user selects the
    > file,
    > > the full path (including file name) should be plonked into the TextBox.
    > > This way, I can programmatically set the text property of the TextBox.
    > >
    > > Any help greatly appreciated.
    > >
    > > Cheers,
    > >
    > > Mr Gordonz
    > >
    > >
    > >
    >
    >

    Mr Gordonz Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139