by Anonymous » 11 Jul 2025, 18:10
Ich versuche, den süßen Alarm als Popup-Nachricht in meiner ASP.NET C# -Anwendung zu verwenden. Aber ich denke, ich mache falsch, denn wenn ich auf die Schaltfläche oder Linkklick klicke, passiert nichts wirklich. Es ist wie ein Element ohne Ereignis. < /p>
Also hier ist der Code. < /p>
JavaScript < /strong> < /p>
Code: Select all
function Confirm(ctl, event) {
event.preventDefault();
swal({
title: "Confirm Logout?",
text: "Do you really want to log this Account out?",
type: "warning",
showCancelButton: true,
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
return true;
} else {
return false;
}
});
}
< /code>
Aspx < /strong> < /p>
[*]
[i][/i]
< /code>
C#< /strong> < /p>
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("login.aspx");
}
Ich versuche, den süßen Alarm als Popup-Nachricht in meiner ASP.NET C# -Anwendung zu verwenden. Aber ich denke, ich mache falsch, denn wenn ich auf die Schaltfläche oder Linkklick klicke, passiert nichts wirklich. Es ist wie ein Element ohne Ereignis. < /p>
Also hier ist der Code. < /p>
JavaScript < /strong> < /p>
[code]
function Confirm(ctl, event) {
event.preventDefault();
swal({
title: "Confirm Logout?",
text: "Do you really want to log this Account out?",
type: "warning",
showCancelButton: true,
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
return true;
} else {
return false;
}
});
}
< /code>
Aspx < /strong> < /p>
[*]
[i][/i]
< /code>
C#< /strong> < /p>
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("login.aspx");
}
[/code]