为什么我不能在页面上返回用户列表?

时间:2016-11-21 14:12:15

标签: asp.net asp.net-mvc entity-framework

此代码应该输出我使用Identity创建的用户。它会将本机属性输出到电子邮件等身份,但由于某种原因,它不会输出上次更改密码的日期。我在物理上看到了我的数据库中的属性,并且能够使用表单输入它没有问题,但是我无法使用IEnumerable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser>来解决它。我该如何解决这个问题?

 @model IEnumerable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser>
    @using PagedList.Mvc;
    <link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
    @{
        ViewBag.Title = "Manage Users";
    }

    @using (Html.BeginForm("ManageUsers", "AdminTools", FormMethod.Get))
    {
        <div class="col-lg-12 col-md-12 section-padding section-top-padding white-background">
            <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" style="width:100%">
                <thead>
                    <tr>
                        <th>Email</th>
                        <th>Password Change Date</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                    <tr>
                        <td>@Html.DisplayFor(modelItem => item.Email)</td>
                        <td>@Html.DisplayFor(modelItem => item.passwordLastChanged)</td>

                    </tr>
                }
            </tbody>
        </table>
        <button type="button" class="buttonIcon dark" data-toggle="modal" data-target="#CreateUserModal"><span class="glyphicon glyphicon-plus-sign fa-lg"> </span>New User</button>

    </div>
}
<div class="modal fade" id="CreateUserModal" role="dialog">
    <div class="modal-dialog">
        @Html.Action("Register", "Account")
    </div>
</div>

0 个答案:

没有答案