JavaScript消息框

标签 javascript .net-2.0

我想在我的 asp.net 应用程序上显示错误消息。此消息是警告消息,这就是我的做法:

CmdCalcInvoke.Attributes["onclick"] = "return confirm('Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change')";

上面的代码工作正常。 CmdCalcInvoke 是一个htmlInputButton。这是消息框显示的消息;

Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change

我想做的是显示此消息,但想通过将其加粗或以红色显示该单词来突出显示警告单词,这可以完成吗???,不记得看到一个消息框这个特点,但我想我会问以防万一

欢迎任何建议

最佳答案

如果您不使用默认警报框,则可以。尝试使用 javascript 模态窗口,它只是普通的 div 标记,您可以控制其样式。查看 jquery 的 blockui(还有很多其他的)

关于JavaScript消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/91434/

相关文章:

javascript - 为什么我的 javascript 正则表达式模式无法捕获多个实例?

javascript - Ionic2/3 应用程序 html 页面上的图像

javascript - 动画 HTML、CSS JavaScript。我怎样才能实现这个

winforms - "Enable the Visual Studio hosting"发布配置的进程编译选项

.net - 如何在后台线程运行时阻止Winforms UI

.net-2.0 - Windows Azure 与.NET 2.0 框架兼容吗?

javascript - 将变量值从 C# 传递到 javascript

javascript - 在 JavaScript 中按 ID 对 div 进行排序

c# - winforms 中的简单 UI 问题

c# - 在静态方法中访问参数的私有(private)成员?