如何创建弹出窗口 [英] how to create a pop up window
本文介绍了如何创建弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在按钮点击时创建弹出窗口以通知用户smth ??
例如..当用户点击保存按钮时...我想要一个弹出窗口通知他更改已保存
how to create a pop up window on button click to notify user to smth??
for example.. when user will click the save button.. i want a pop window to notify him that the changes were saved
推荐答案
如果窗口形式:
If windows form:
private void button1_Click(object sender, EventArgs e)
{
Messagebox.Show("Changes saved");
}
if webform:
if webform:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
alert("Changes saved!");
}
</script>
</head>
<body>
<input type="button" onclick="myFunction()" value="Show alert box">
</body>
</html>
使用以下代码:
Use Following Code :
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert(''Data Saved Successfully!!'')", true);
为此您可以使用AJAX模态弹出控件(我希望您知道这一点):
动态AJAX模态弹出 [ ^ ]
模态弹出叠加 [ ^ ]
For that you can use AJAX Modal Popup Control (I hope you are aware about this) :
Dynamic AJAX Modal Popup[^]
Modal Popup Overlay[^]
这篇关于如何创建弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文