这是我写的代码。
if (propertyModel.PropertyName.Replace(" ", "") != model.PropertyName.Replace(" ", "") && propertyModel.PropertyRegistrationCompletedPercentage >= 71)
{
var originalDirectory = new DirectoryInfo(string.Format("{0}Images\\ProprtyImages", Server.MapPath(@"\")));
string pathString = System.IO.Path.Combine(originalDirectory.ToString(), propertyModel.PropertyName.Replace(" ", "") + "__" + User.Identity.GetUserId().Replace("-", "") + "__" + "propertyid" + "__" + propertyModel.PropertyId.ToString());
string newpathstring = System.IO.Path.Combine(originalDirectory.ToString(), model.PropertyName.Replace(" ", "") + "__" + User.Identity.GetUserId().Replace("-", "") + "__" + "propertyid" + "__" + propertyModel.PropertyId.ToString());
bool isExists = System.IO.Directory.Exists(pathString);
if (isExists)
{
Directory.Move(pathString, newpathstring);
}
else
{
ViewBag.Message = "Unexpected IO error occurred.";
return View("ErrorPageWithCustomMessage");
}
}
Session["PropertyRegistrationCompletedPercentage"] = propertyModel.PropertyRegistrationCompletedPercentage;
Session["IsPropertyBeingStartedToAdd"] = propertyModel.IsPropertyBeingStartedToAdd;
Session["IsPropertyAddingCompleted"] = propertyModel.IsPropertyAddingCompleted;
Session["IsThePropertyVerified"] = propertyModel.IsThePropertyVerified;
当我尝试在重定向到另一个操作后检索会话变量时,这些值是如何解决的?