-1
我在我的頁面中有一張表,列出了用戶和電子郵件,當用戶發送這些信息時 我如何讓這個表格爲每個帖子添加一行而不刪除其他行?在表格中自動添加行HTML
我的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;
}
}
}
韓國社交協會!我在哪裏添加此代碼? – CaioVJesus89
高興地幫助你,在btnSendUser_OnClick結束時 –
抱歉,沒有爲每個「btnSendUser_OnClick」添加一行。它取代了我上一行和下一行的價值,寫下同樣的東西。我通過兩行獲得相同的信息。它只創建一個列信息(「用戶名」)。 – CaioVJesus89