我的页面中有一个表格,其中列出了用户发送此信息时的用户和电子邮件我如何使此表格为每个帖子添加一行而不删除其他行?
我的 aspx
<table id="tblUsers" class="table table-bordered table-striped">
<tbody id="tbodyUser">
<tr>
<asp:Label ID="lblHeader" Font-Bold="true" runat="server" Visible="false">User to Access</asp:Label>
<td>
<asp:Label ID="lblUser" runat="server" Visible="false"></asp:Label>
</td>
<td>
<asp:Label ID="lblEmail" runat="server" Visible="false"></asp:Label>
</td>
</tr>
</tbody>
</table>
我的.cs
protected void btnSendUser_OnClick(object sender, EventArgs e)
{
string LoginInfo = txtUserAdd.Text;
PrincipalContext insPrincipalContext = new PrincipalContext(ContextType.Domain, "x.com", "amsndrsecuritysqlser", "xxx");
UserPrincipal insUserPrincipal = UserPrincipal.FindByIdentity(insPrincipalContext, LoginInfo);
//it's to first post
if (lblUser.Visible == false && lblEmail.Visible == false)
{
if (insUserPrincipal == null)
{
lblError.Visible = true;
}
else
{
lblUser.Visible = true;
lblEmail.Visible = true;
lblHeader.Visible = true;
lblUser.Text = insUserPrincipal.GivenName + " " + insUserPrincipal.Surname;
lblEmail.Text = insUserPrincipal.EmailAddress;
}
}
}