[英]Is it possible to get Message Box in web forms?
I tried but I guess Message Box only works with win forms. 我尝试过,但我想消息框仅适用于获胜表格。 What is the best alternative to use in web forms? 在Web表单中使用的最佳替代方法是什么?
You can use confirm
for yes/no questions and alert
for "OK" messages in JavaScript. 您可以使用confirm
为是/否的问题,并alert
在JavaScript的“OK”的消息。
The other alternative is to use JavaScript to pop up a new window that looks and acts like a message box. 另一种选择是使用JavaScript弹出一个外观和行为类似于消息框的新窗口。 Modality in this case varied by browser. 在这种情况下,模式因浏览器而异。 In Internet Explorer, the method 在Internet Explorer中,方法
window.showModalDialog(url,name,params)
will display a modal dialog. 将显示一个模式对话框。 The Mozilla approach is to still use Mozilla的方法是仍然使用
window.open(url,name,params)
but add modal=yes
to the params
list. 但是将modal=yes
添加到params
列表中。
result = confirm('Yes or no question here.')
JavaScript:
alert("This box has an OK button.");
The Ajax ModalPopup also works nicely. Ajax ModalPopup也可以很好地工作。 Here is an example: 这是一个例子:
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx
您有dojo对话框小部件: http : //www.dojotoolkit.org/,并且可以将其用作消息框。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.