/*-----Title-----*/
<script type="text/javascript" src="Script/jquery-1.4.1.min.js"></script>
/*-----JQuery-----*/
<script type="text/javascript">
$(function () {
$('.selectPic').change(function () {
$(".previewPic").attr("src", "Content/Loading.gif");
var _file = this.files[0]; //选择上传的文件
var r = new FileReader();
r.readAsDataURL(_file); //Base64
$(r).load(function () {
$(".previewPic").attr("src", this.result);
});
});
});
</script>
/*-----Page-----*/
<div class="selectArea">
<span>选择图片 >></span>
<asp:FileUpload ID="FileUpload1" runat="server" accept="image/*" CssClass="selectPic" />
</div>
<div class="previewArea">
<asp:Image runat="server" ID="Image1" CssClass="previewPic" />
</div>