美文网首页
WebApi 调用Edit后某个ViewModel的字段为nul

WebApi 调用Edit后某个ViewModel的字段为nul

作者: AsaGuo | 来源:发表于2018-07-22 22:24 被阅读27次

    View中未设置该字段“ImageGroupsNum”:
    @Html.EditorFor(model => model.ImageGroupsNum, new { htmlAttributes = new { @class = "form-control",@style= "visibility:hidden;" } })

    后台Edit方法,未Bind该字段“ImageGroupsNum”:
    public ActionResult Edit([Bind(Include = "Id,Name,AboutUs,QRImgName,QRImgUrl,ImageGroupsNum")] WebSiteConfigViewModel webSiteConfig)

    相关文章

      网友评论

          本文标题:WebApi 调用Edit后某个ViewModel的字段为nul

          本文链接:https://www.haomeiwen.com/subject/rdgjkftx.html