0
我嘗試通過單擊刪除按鈕(如果用戶比在對話框中刪除數據,但是當我按下刪除對話框然後消失時顯示jquery對話框第二次和屏幕彈出後。 我喜歡別人幫我,因爲我真的jQuery的 綠色以及如何檢查對話框 批准的用戶代碼謝謝:)通過按下按鈕(無輸入)顯示jquery對話框
<script type="text/javascript">
$(function() {
$("#dialog-confirm").hide();
$("#but_Delete").click(function() {
$("#dialog-confirm").dialog({
resizable: false,
height: 250,
width: 500,
modal: true,
buttons: {
"Delete ": function() {
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
});
$(".selector").dialog({
closeOnEscape: false
});
});
});
</script>
<asp:Button ID="but_Delete" UseSubmitBehavior="false" runat="server" Height="26px" OnClick="but_Delete_Click" Text="מחק" Width="93px" />
protected void but_Delete_Click(object sender, EventArgs e)
{
if (TextBox_campeny.Text != null || TextBox_Addres.Text != null || TextBox_tel.Text != null)
{
con.Open();
string id = tb.Tables[0].Rows[i]["id"].ToString();
SqlCommand cmd = new SqlCommand("Delete from tbl_Customer where Id='" + id + "'", con);
cmd.ExecuteNonQuery();
Response.Write("הרשומה נמחקה בהצלחה!");
con.Close();
con.Open();
SqlCommand cmd_u = new SqlCommand("Delete from tbl_Users where IdCustomer='" + id + "'", con);
SqlDataAdapter dac = new SqlDataAdapter(cmd_u);
dac.Fill(tb);
if (butuc == 1)
{
Response.Redirect("LoginPage.aspx");
}
else
{
if(tb.Tables[0].Rows.Count != 1)
{
if (i == 0)
{
bind();
}
else
{
if (tb.Tables[0].Rows.Count - 1 == i)
{
i--;
bind();
}
else
bind();
}
}
else
{
Empty_Textbox();
but_Delete.Enabled = false;
}
}
}
}
con.Close();
}
請修復你的代碼片段...它被切斷一半 –