我可以在 Gridview 中显示用户配置文件的信息,但我无法显示用户的电子邮件。请在我的代码下方看到:
<asp:GridView ID="GridUser" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" AutoGenerateColumns="False">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
<asp:BoundField DataField="UserName" HeaderText="UserName" />
<%--<asp:BoundField DataField="EMail" HeaderText="E-Mail Address" />--%>
</Columns>
</asp:GridView>
在代码隐藏中:
List<object> profileList = new List<object>();
MembershipUserCollection muc = Membership.GetAllUsers();
foreach (MembershipUser mu in muc)
{
profileList.Add(Profile.GetProfile(mu.UserName));
}
GridUser.DataSource = profileList;
GridUser.DataBind();
现在,如何在 Gridview 中显示用户的电子邮件和用户的个人资料?