Prompt user with OpenFile dialog

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
 
M

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
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top