如何在asp.net中为fileupload控件赋值

问题描述:





如何使用c#在asp.net的代码视图中为fileupload控件指定默认值。



数据库中有一个图像路径。我希望在检索时显示FileUpload文本中的路径。



再见

Hi,

How to assign default value to fileupload control in code view in asp.net with c#.

There is an image path in database. I want show that path in FileUpload text at the time of retrieval.

Bye

请参阅此链接:



http://forums.asp.net/ t / 1615510.aspx [ ^ ]
Refer this link:

http://forums.asp.net/t/1615510.aspx[^]


据我所知,你不能。对不起,那就是 FileUpload 控制的方式。它希望用户使用它的浏览按钮选择文件。



但是,如果他们是任何人,你可能会尝试在Google上找到解决方法。



Google搜索结果
As per my knowledge you can not. Sorry but thats how FileUpload control is. It expects Users to select File using it''s "Browse" button.

However you may try to find out work around for this on Google if their is any.

Google Search Result


由于浏览器的安全性,这是可以防止的。



查看此

http://forums.asp.net/t/1435276.aspx [ ^ ]
due to browser security, this is prevented.

Check this
http://forums.asp.net/t/1435276.aspx[^]