且构网

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

ASP.NET MVC2 - 勾成客户端验证

更新时间:2022-03-10 21:54:25

找到了。

<script type="text/javascript">
    $(function () {
        var old_displayError = Sys.Mvc.FormContext.prototype._displayError;
        Sys.Mvc.FormContext.prototype._displayError = function () {
            old_displayError.apply(this);
            // do other stuff here
        }
    });
</script>

我不习惯覆盖原型的功能,所以我难倒了一下。

I'm not used to overriding prototype functions, so I was stumped for a bit.