当前位置: 代码迷 >> ASP.NET >> mvc生成强类型编辑视图,怎么绑定值
  详细解决方案

mvc生成强类型编辑视图,怎么绑定值

热度:1174   发布时间:2013-02-25 00:00:00.0
mvc生成强类型编辑视图,如何绑定值
HTML code
        <div class="editor-label">            @Html.LabelFor(model => model.UserRealName)        </div>        <div class="editor-field">            @Html.EditorFor(model => model.UserRealName)            @Html.ValidationMessageFor(model => model.UserRealName)        </div>        <div class="editor-label">            @Html.LabelFor(model => model.UserAddress)        </div>        <div class="editor-field">            @Html.EditorFor(model => model.UserAddress)            @Html.ValidationMessageFor(model => model.UserAddress)        </div>

以上是自动生成的代码.
我现在有一个Users user.如何把user里面的值绑定到其中去

------解决方案--------------------------------------------------------
那就从控制器里返回要展示的这个Model,然后页面接受该Model
  相关解决方案