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 ...