显示图片
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