且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何显示“是的,没有取消".使用C#在ASP.Net中显示消息

更新时间:2023-12-05 23:51:04

您可以尝试编写具有所需布局的页面,并通过Javascript将其显示为弹出窗口.请记住,使用弹出窗口阻止程序的人不会看到您的消息框.

有什么理由不能将您的反馈意见放在主要表格上?也许作为一个可以通过更改其display样式进行显示和隐藏的面板.
You could try writing a page with the desired layout and displaying it via Javascript as a pop-up. Just keep in mind that people with pop-up blockers will not see your message box.

Is there any reason why you cannot put your feedback on the main form? Perhaps as a panel that you can display and hide by changing its display style.


在客户端获取按钮组合的唯一方法是使用vbscript MsgBox之类;
The only way to get that combination of buttons on the client side is to use a vbscript MsgBox like;
<script type="text/vbscript">
sub mySub()
x=MsgBox("Are you a programmer?",3,"Please answer")
end sub
</script>



请记住,这样做只会使其在IE中可用.

阅读 [ ^ ],以获取有关vbscript MsgBox的信息.

如果您只需要确定和取消,就可以使用 JavaScript确认对话框 [ ClientScriptManager.RegisterStartupScript方法 [^ ]



Just remember doing this will make it only usable with IE.

Read this[^] for information on the vbscript MsgBox.

If all you need is OK and Cancel you can use a Javascript confirm dialog[^] this will also work with other browsers.

To get this to the client side from the C# server side you would need to use ClientScriptManager.RegisterStartupScript Method[^]