在Page_Load里面加入:
Button1.Attributes["onClick"] = "javascript:return confirm('Yes or No?');";
在页面点击Button1时,会弹出一个确认框,如果点"确定"则会执行Button1的Click事件,点"取消"则什么也不执行
Button1.Attributes["onClick"] = "javascript:return confirm('Yes or No?');";
在页面点击Button1时,会弹出一个确认框,如果点"确定"则会执行Button1的Click事件,点"取消"则什么也不执行
------------------------------
yourWebCtrl.Attributes["OnClick"] = "javascript: return confirm('Yes or No?';";
yourWebCtrl.Attributes["OnClick"] = "javascript: alerm('warning...');";string s = @"<script language=javascript> window.open(...); </script>";
or use window.showModalDialog(...)
and window.showModelessDialog(...)
http://www.aspxcontrol.com/download/WebMessageBox.zip
response.write("<script language=javascript>alert('内容')</script>")
如果想弹出一个具有交互效果的对话矿,则用
Button1.Attributes["onClick"] = "javascript:return confirm('Yes or No?');";