FileUpload Control

B

bsm

Hi,

I want to Set asp:fileupload Filename at runtime. When I try to do, it
shows "Readonly" error. Anyway to achieve this.
 
M

Mark Rae

I want to Set asp:fileupload Filename at runtime. When I try to do, it
shows "Readonly" error. Anyway to achieve this.

Absolutely not, for fairly obvious security reasons!

Imagine a public website with a hidden FileUpload control which uploaded
people's accounts database, or their Windows password file...
 
G

Guest

It is a read-only property and is automatically set by the ASP.NET runtime
when the user posts back the page with uploaded file from the browser.
 
B

bsm

Absolutely not, for fairly obvious security reasons!

Imagine a public website with a hidden FileUpload control which uploaded
people's accounts database, or their Windows password file...

--http://www.markrae.net

Actually My requirement was-
I have a File Upload control and one DropDownControl. I set
AutoPostBack is true to my DDL. After choosing Filecontrol, if i
change DDL value. The filename has got reset. which our users don't
like this. Do u have any alternate?
 
K

Kevin Spencer

A FileUpload will not retain its' value between postbacks for security
reasons. Therefore, as long as the ListBox doesn't post back, you won't have
a problem.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
B

bsm

A FileUpload will not retain its' value between postbacks for security
reasons. Therefore, as long as the ListBox doesn't post back, you won't have
a problem.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net







- Show quoted text -

Thanks for the information.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top