Hi, I want to know the working of UpdateModel() method. I just know about it is for update the current model data. but how it works exactly ? Because while I am using the UpdateModel() in edit controller method, there is functionality of file uploads. I am keeping the path of uploaded file in my db. but after executes the UpdateModel method value of path is replaces with "System.Web.HttpPostedFileWrapper" . why this should happens : Code:
if (!String.IsNullOrEmpty(Request.Files["TDSCertificatePath"].FileName))
{
TrustTrusteeMapping objTrustTrusteeMapping = trust_trustee_mapping_management.GetTrustTrusteeMappingById(objTDSDetail.TrustTrusteeMappingId);
string TrustTrusteeMappingName = objTrustTrusteeMapping.Trust.TrustName + "_" + objTrustTrusteeMapping.TrusteeMaster.FullName;
HttpPostedFileBase fileToUpload = Request.Files["TDSCertificatePath"];
objTDSDetail.TDSCertificatePath = CommonFunctions.UploadFile("TDSCertificatePath", "Content\\TDSCertificate\\", TrustTrusteeMappingName, fileToUpload);
fileToUpload = null;
objTrustTrusteeMapping = null;
}
UpdateModel(objTDSDetail);//After executes this the value of objTDSDetail.TDSCertificatePath changes as I said before.