Prompt user with OpenFile dialog

  • Thread starter Thread starter Mr Gordonz
  • Start date Start date
M

Mr Gordonz

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
 
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
 
Back
Top