[英]How to close sweetalert popup from code behind
I'm using SweetAlert to show loading popup.我正在使用 SweetAlert 来显示加载弹出窗口。 I want to close the popup when a process in codebehind is finished, How can I achieve that?
我想在代码隐藏中的进程完成后关闭弹出窗口,我该如何实现?
function showLoading() {
swal({
title: "Loading...",
text: "Please wait",
imageUrl: "/content/loader.gif",
imageHeight: 200,
imageWidth: 200,
button: false,
closeOnClickOutside: false,
closeOnEsc: false
})
}
protected void btn1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "loading", "testLoad()", true);
beginProcess();
}
Try this after beginProcess():在 beginProcess() 之后试试这个:
ClientScript.RegisterStartupScript(this.GetType(), "close", "swal.close()", true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.