如何使用 Javascript 在 asp.net 页面中显示是/否按钮

发布于 2024-07-10 21:24:37 字数 146 浏览 13 评论 0原文

我必须在我的 asp.net 页面上的某些条件下显示是/否按钮,我使用 windows.confirm() 来显示该按钮,但是 windows.confirm 显示确定/取消按钮,有什么方法可以在中显示是/否按钮asp.net 页面而不是使用 Javascript 确定/取消?

I have to display yes/no button on some condition on my asp.net page , I used windows.confirm() to display that but windows.confirm displays Ok/Cancel Button , Is there any way I can display Yes/No Button in asp.net page instead of Ok/Cancel using Javascript ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

我不咬妳我踢妳 2024-07-17 21:24:37

如果你想保持简单,只需检查一些 jQuery 或 YUI 插件,你就可以用几行代码启动并运行它。

例如,使用 jQuery 和 这个使用 YUI。

If you want to keep it simple, just check some of the jQuery or YUI plugins, you can get that up and running with a couple of lines of code.

For example, this one uses jQuery and this one uses YUI.

分开我的手 2024-07-17 21:24:37

您无法更改 JavaScript 警报上的按钮文本,并且虽然您无法更改 VBScript 消息框上的按钮文本,但它具有不同的文本。 我解决这个问题的方法是开发一个自定义 div,其中包含带有正确文本的按钮,这些按钮使用绝对定位和阴影效果显示,以提供消息框的外观。

You cannot change the button text on a JavaScript alert, and while you can't change them on a VBScript message box, it has different text. How I got around this was to develop a custom div that contains buttons with the correct text on them that is displayed using absolute positioning and a shadow effect to give the appearance of a message box.

春夜浅 2024-07-17 21:24:37

如果不创建自定义模式对话框或使用已构建的模式,则无法跨浏览器。 如果你可以使用 ms ajax 那么它有一个你可以使用的模式。

not cross browser without creating an custom modal dialong or using one that is already built. if you can use ms ajax then it has a modal you can use.

云仙小弟 2024-07-17 21:24:37

您不能使用提示来完成此操作,您可以显示一个隐藏的 div,其中包含 html 控件和连接到按钮的 javascript。 当你想问问题时,显示之前隐藏的 div。

You can't do it using prompt, you can show a hidden div with html controls and javascript wired up to buttons. When you want to ask the question show the previously hidden div.

沒落の蓅哖 2024-07-17 21:24:37

尝试这个。

JS代码:
`if(confirm('你确定吗???')){
{

}其他{

}`

Try this.

JS code:
`if(confirm('Are you sure???')){
{

}else{

}`

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文