如何保存图像后如何在UI中更新图像?(文件上传) [英] How to Update image in UI after how to save image ?(file upload)
本文介绍了如何保存图像后如何在UI中更新图像?(文件上传)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Image路径中保存了Image,然后在Gridview中显示了它。我的问题是网格视图编辑按钮是他们的。当我在Fileupload控件中重新处理图像后单击编辑按钮时,是可能的还是其他方式? 。 Geidview中的图像未更新。它位于上方
任何人帮我...
这是保存代码..我需要更新代码
I saved Image in Image path and I display that in Gridview. My Problem is IN Grid view Edit button is their. When i will click edit button after I Retrive the image in Fileupload control, It is possible or any another way? . Image Not Update in Geidview . It is in upper side
Any One Help me ...
This is Save Code ... I need Update Code
protected void Upload(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
Response.Redirect(Request.Url.AbsoluteUri);
}
}
推荐答案
protected void Upload(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
Response.Redirect(Request.Url.AbsoluteUri);
}
else
{
//save ur file to a label on edit time.
//Then assign the data to here..
}
}
这篇关于如何保存图像后如何在UI中更新图像?(文件上传)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文