我正在使用 SQL Server Management Studio 开发 Visual Studio 2010。
我制作了一个用于从表中删除选定行的按钮。
<asp:Button ID="btnDeleteSelectedMessages" runat="server"
Text="Verwijderen" Enabled="false"
OnClick="btnDeleteSelectedMessages_Click" />
当我第一次运行页面时,它第一次完美运行。
然后在按钮不能被第二次点击之后。
按钮点击事件的代码是这样的。
protected void btnDeleteSelectedMessages_Click(object sender, EventArgs e)
{
if (currentGridView == null)
setCurrentGridView();
//controleer voor elke rij welke checkbox is geselecteerd
foreach (GridViewRow row in currentGridView.Rows)
{
var cb = (HtmlInputCheckBox)row.FindControl("chkPaid");
Guid messageID = (Guid)currentGridView.DataKeys[row.DataItemIndex].Value;
//als de checkbox is geselecteerd het bericht verwijderen
if (cb != null && cb.Checked)
{
if (currentGridView.ID.Equals("Messages"))
b.BussinesMessageReceiver.DeleteMessageReceiver(messageID, MessageBoxPerson);
else if (currentGridView.ID.Equals("MessagesSent"))
b.BussinesMessage.DeleteMessageSender(messageID);
else //MessagesDeleted
b.BussinesMessage.DeleteMessage(messageID, (Page.Server.MapPath("~/Upload/") + messageID));
continue;
}
}
btnDeleteSelectedMessages.Enabled = false;
selectLocation.Visible = false;
clearSelectedMessageSession();
//Update the GridView
BindGridView();
}
谁能帮我?