Posted on: 6/25/2014 6:47:21 PM | Views : 370

HI,
I want to add this "pending.jpg" as the filename when nothing is selected in the FileUpload control. 
The bellow code is somehow working except for when I try to check for HasFile == false. 
else if (fPhoto_fup.HasFile == false) { f.Photo = "photo-pending.gif"; } //Using EntityFramework int i = Convert.ToInt32(fId_hid.Value); ED f = c.ED.SingleOrDefault(a => a.ID == i); string photoFileName = f.Photo; if (photoFileName == null || photoFileName == "" && fPhoto_fup.HasFile) { PhotoUpload(); f.Photo = fPhoto_fup.FileName; } else if (photoFileName != null && fPhoto_fup.HasFile) { PhotoUpload(); f.Photo = fPhoto_fup.FileName; } else { ...

Go to the complete details ...