如何使用文件上载控件预览图像 [英] How to preview Image Using file upload control

查看:71
本文介绍了如何使用文件上载控件预览图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用fileupload控件(或)在IE 8上运行的ajax文件上传控件选择图像后预览图像immediatley。请帮助我。

How to preview image immediatley after selecting image using fileupload controls (or) ajax file upload control which works on IE 8. please help me.

推荐答案

设置图像字段下方到上传控件。

并在上传文件时设置Imageurl



Set image Field Below to the Upload Control.
and set the Imageurl when you Upload a file

protected void btnUpload_Click(object sender, EventArgs e)
{
    FileUpload1.SaveAs(Server.MapPath("test.jpg"));
 
    Image1.ImageUrl = "~/test.jpg";

}


这篇关于如何使用文件上载控件预览图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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