且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在asp.net中的fileupload控件中设置默认图像路径

更新时间:2022-12-06 07:38:03

if (FileUpload = "")
   img.imgUrl = "default.jpg";
else
   img.imgUrl = FileUpload.Path;


我不知道对方说的是什么,但你不能设置文件上传控件的路径,因为如果可以,您可以使用系统文件的路径隐藏页面上的一个并以这种方式破解某人的系统。你不能在js或你的html中设置它。
I dunno what the other guy is saying, but you can''t set the path to a file upload control, because if you could, you could hide one on your page with the path to a system file and hack someone''s system that way. You can''t set it in js or in your html.