javascript消息框

时间:2020-03-06 14:20:43  来源:igfitidea点击:

我想在我的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标记。在blockui中查找jquery(还有其他负载)

我们可以尝试类似的方法:http://weblogs.asp.net/johnkatsiotis/archive/2008/09/14/asp-net-messagebox-server-and-client.aspx

我使用的模态对话框控件是:
http://foohack.com/tests/vertical-align/dialog.html
http://foohack.com/2007/11/css-modal-dialog-that-works-right/

我发现它在所有浏览器上都能正常运行。我已经破解了它,以便与ASP .NET很好地配合使用,这非常容易。

无法将格式应用于标准对话框。但是,如果我们真的要对其进行格式化,则可以在按钮旁边或者作为绝对放置的div(用CSS格式化)将HTML消息闪烁显示。

否则,使用类似基于LightBox的解决方案(如Thinbox)吗?