473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

Nov 17 '05 #1
1 1285
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" <ca**********@m-s-solutions.co.uk> wrote in message
news:%2****************@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" <pa**@mobius.net.au> wrote in message
news:uk**************@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


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gord | last post by:
Hello, If you set the flag for an overwrite prompt using the 'Save' common dialog, how do you read the response when the user clicks the Yes or No in the 'overwrite' message box? Everything...
3
by: sancha | last post by:
Hi, I need to promt the user when he moves away from the page by clicking an of the links available on the page. I was trying to use the onbeforeunload function but it seems it is a jScript...
4
by: dave | last post by:
I have an app that uses the OpenFile Dialog class. When I invoke the ShowDialog method, the hourglass appears and just stays. The dialog window never opens. I created a test form with an...
3
by: J.P. Cummins | last post by:
In my ASP.NET application, I wish to have a page for administrators to edit items in a list. Preferably, I would like to use the javascript prompt for the 'rename' function, and a javascript alert...
2
by: ambersaria420 | last post by:
I need to prompt the user to enter ID. I can open up prompt fine using javascript code below. However I am not sure how to get value that user entered in user prompt window. I have to check this...
3
by: Billy Cormic | last post by:
Hello, I would like to write a windows application that can get the IP address of the computer the appliation is installed on. Then the program should ftp a file to another computer. I have no...
4
by: Henry C. Wu | last post by:
Hi I was wondering how can I program a button to make the ODBC dialog box appear or prompt the user. And once the user has selected his/her choice the connection string will be saved at a variable....
0
by: dieter grobler | last post by:
Hi there, I wanted to know if there is a way to specify the default location the OpenFileDialog shows when the browse button is pressed on the FileUpload Control. i.e "c:\program files\". I know...
4
by: Marco Trapanese | last post by:
Hi! I show an OpenFile Dialog with: dlgOpen.ShowDialog() but I'd like to change the default view among Detail, Thumbnail, Icons, ect. Users change the view mode by this button: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.