On Edit, how to assign filename (stored in SQL database as a string) to fileupload control.
public ActionResult editLeaveRequest(int id)
var model = hc.leaveRequests.Find(id);
model.documentUpload.FileName = model.fName;
Property or Indexer 'HttpPostedFileBased.FileName' cannot be assigned to -- it is read only`
You should live with the fact that every time you reload your page, file upload input will be empty. What you need to do is:
model.documentUploadcheck to see if new file was posted and if it was, replace existing file with the new one.