TextBoxfor显示初始值,而不是从代码中更新的值
public ActionResult Index(DataSites DataSiteList){ if (DataSiteList.Latitude != null) { DataSites test = new DataSites(); test.Latitude = "LATITUDE"; return View(test); } return View(DataSiteList);}public ActionResult SomeInformation(){ DataSites test1 = new DataSites(); test1.Latitude = "LATITUDE2"; return RedirectToAction("Index", test1);}
@model miniproj2.Models.DataSites<p> @Html.TextBoxFor(x => x.Latitude)</p>
public class DataSites{ public string Latitude { get; set; }}
DataSites
' Latitude
Index()
万千封印