צפיות
תשובות
קריאה לפונקציה שנמצאת בצד השרת מתוך jquery dialog
יש לי תיבת דו שיח בjquery שמוצגת כאשר המשתמש לוחץ על מחיקת רשומה
אני מעוניינת שכאשר המשתמש יאשר מחיקה אז הרשומה תמחק ע"י הפונקציה
הנה הפונקציה שבCode behind
Code behind protected void Delete_Click(object sender, EventArgs e)
{
if (Text_AddressU.Text != null || TextBox_Addres.Text != null || TextBox_tel.Text != null)
{
con.Open();
if (tb.Tables[0].Rows.Count != 0)
{
string id = tb.Tables[0].Rows[i]["Id_user"].ToString();
SqlCommand cmd = new SqlCommand("Delete from tbl_Users where Id_user='" + id + "'", con);
cmd.ExecuteNonQuery();
Response.Write("הרשומה נמחקה בהצלחה!");
……. EmptyU_Textbox();
butU_Delete.Enabled = false;
}
}
}
}
con.Close();
והנה הscript
<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 () {
$.ajax({
type: "GET",
contenttype: "application/json; charset=utf-8",
data: "{10}",
url: "Home.aspx/but_Delete_Click",
dataType: "json",
success: function but_Delete_Click(data)
{
source = $.parseJSON(response.data);
}
});
$(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
//$(".selector").dialog({Zz
// closeOnEscape: false
//});
});
});
</script>
אני מחפשת בנרות פתרון אשמח אם תסייעו לי.
0 תשובות