上传图像并在图像控件中显示时显示上一张图像 [英] when uploading image and display in image control shows previous image

查看:79
本文介绍了上传图像并在图像控件中显示时显示上一张图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..

将图像上传到文件夹并将图像绑定到图像控件后,注销并显示前一个图像,然后登录将显示当前图像.对于每个上传的图像,该图像将图像绑定到图像控件,但不会刷新
有人可以帮我吗

在此先感谢您

hi all..

uploading images into folder and bind image to image control it shows previous image after log out and log in it will displays current image am binding image to image control for every uploaded image but it not getting refresh
can any one help me please

thanks in advance

推荐答案

当您的图片将被上传时,然后调用图片绑定方法或编写代码以使用控件

When your image will be uploaded then at that time call a image binding method or write a code for binging that particular image with your control

string path = "~/Images/" + FileUpload1.FileName;
Image1.ImageUrl = path;
Image1.DataBind();



在这里,我已将所有图像上传到图像"存储区中,因此我使用了〜/Images/"
您可以使用此路径插入,并使用FileUpload控件的FileName属性获取上传的文件名,该属性用于将当前图像绑定到图像查看器控件...



here i have uploaded all my images in to Images derictory so i used "~/Images/"
you can use your path insted this and get the uploaded file name using FileUpload controls FileName property for binding current image to your image viewer control...


这篇关于上传图像并在图像控件中显示时显示上一张图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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