将验证摘要消息框标题更改为自定义 [英] Change validation summary messagebox Title to custom

查看:90
本文介绍了将验证摘要消息框标题更改为自定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我正在使用验证摘要.我的消息框显示良好,但标题为来自网页的消息"出现.我需要将此标题更改为我的习惯.

如果有解决方案,请提出建议.


Dear ,

I am using validation summary. My message box displayed well but at its title "Message from webpage" appears. I need to change this title to my custom.

Please suggest me if any solution .


Thanks.

推荐答案

下载JQuery Alert并将此行添加到您的母版页.
Download JQuery Alert and add this line to your master page.
<script type="text/javascript">
    window.alert = function (txt, title) {
        if (title === undefined) title = "Default Name";
        jAlert(txt, title);
    };
</script>


由于ValidationSummary控件显示的消息框是Javascript alert(),因此无法更改标题.

您可以创建一个继承自ValidationSummary的自定义服务器控件,并覆盖Render()方法以显示看起来像消息框的隐藏html元素
As the message box displayed by the ValidationSummary control is a Javascript alert(), you can''t change the title.

You could create a custom server control that inherits from ValidationSummary and override the Render() method to show a hidden html element that looks like a message box


也请检查jquery警报框 [
Also check jquery alert box[^] you can display the title you want.


这篇关于将验证摘要消息框标题更改为自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆