ASP.Net模型(GET)没有显示价值

时间:2017-06-04 09:16:40

标签: asp.net-mvc

映射我的模型但值不是设置......很奇怪,

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="">

查看viewdata&gt;模型 enter image description here

已针对ResourceId设置了值... 想法?

0 个答案:

没有答案