读书人

显示图片,该如何解决

发布时间: 2012-03-07 09:13:51 作者: rapoo

显示图片
protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.HasFile)
{
string path, filepath;
path = Server.MapPath(".");
filepath = path + this.FileUpload1.FileName;
this.FileUpload1.SaveAs(filepath);
this.Image1.Visible = true;
this.Image1.ImageUrl = "." + this.FileUpload1.FileName;

}
else
{
Label1.Text = "this is null!";
}

各位帮我改一下,为什么执行的时候图片可以上传却没有显示?

[解决办法]
this.Image1.ImageUrl =filepath

读书人网 >asp.net

热点推荐