映射我的模型但值不是设置......很奇怪,
public ActionResult Appointment(string date = null, string id)
{
// Do stuff
var rId = _resource.Find(id)
var model = new ViewModels.AppointmentNew()
{
ResourceId = rId;
}
return View("Appointment", model);
}
HTML \视图
@Html.HiddenFor(model => model.ResourceId)
@Html.HiddenFor(model => model.Id)
HTML渲染
<input id="ResourceId" name="ResourceId" type="hidden" value="">
已针对ResourceId设置了值... 想法?