如何在asp.net中的fileupload控件中设置默认图像路径 [英] how to set a default image path in fileupload control in asp.net

查看:248
本文介绍了如何在asp.net中的fileupload控件中设置默认图像路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

how to set a default image path in fileupload control in asp.net.

推荐答案

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.


这篇关于如何在asp.net中的fileupload控件中设置默认图像路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆