开发者

Optionally turning off Model Validation using jQuery

There are similar posts on here but none that cover exactly what I want to acheive.

I a class which implements attribute validation such as;

public class Address
{
    [Required]
    public String Line1;
}

When I bind this property to my View, in certain circumstances (usually through exceptional circumstances) I want to remove the requirement for the user to enter a value into Line1

The Views I use tend to be loaded via Ajax and therefore validation is initiated using jQuery. Therefore I need a solu开发者_C百科tion using jQuery.

Any ideas?


There is nice possibility by jQuery Validation Plugin. But you of course need the validation on client and on server, right, because client validation is for the good user, but worth nothing for the evil user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜