hi
I have fileupload control in my page below is code
protected void BtnUpload3Img_Click(object sender, EventArgs e)
{
uploadImageError.Visible = true;
if (fup3.HasFile && fup3.PostedFile.ContentLength < 102400)
{
string path = Server.MapPath("~/image/House/product/");
string fileName = System.IO.Path.GetFileName(fup3.PostedFile.FileName);
if (Array.IndexOf(new string[] { ".jpg", ".png" }, System.IO.Path.GetExtension(fup3.PostedFile.FileName).ToString().ToLower()) < 0)
{
uploadImageError.Text = "please upload .jpg or .png files";
return;
}
while (System.IO.File.Exists(path + "\\" + fileName))
{
fileName = "1" + fileName;
}
fup3.PostedFile.SaveAs(path + fileName);
ViewState["Id"] = House_p.SaveImageName3(fileName, Session["behcode"].ToString(), Convert.ToInt32(ViewState["Id"]));
uploadImageError.Text = "*Upload successfully";
this.imgProduct3.ImageUrl = GetThumbNail("~/image/house/product/" + fileName);
lblProduct3.Visible = upUploadImage3.Visible = !(btnDeleteImage3.Visible = imgProduct3.Visible = true);
lblErrorSubmit.Text = " ";
imgProduct3.Visible = true;
}
else
{
uploadImageError.Text = "please upload files with less than 100KB";
}
}
when I select image and upload it and after that refresh page it again upload image that I upload with fileuoploadcontrol before...
I want when I upload image with fileuploadcontrol and refresh page it doesn't upload image again...
how I can do it?
Best regards
Neda