還真的是 bug 耶! 好久沒碰到原廠 bug 了!
參考 ASP.NET Forums
懶得進去看的人可以抄這份,我從裡面類似的解改過來的
private bool? _lastValid = null;
protected void CustomValidator_TypeA_ServerValidate(object source, ServerValidateEventArgs args)
{
if (_lastValid != null) // prevent second validate
{
args.IsValid = _lastValid.Value;
return;
}
if(something) // your validation logic
{
_lastValid = true;
}
else
{
_lastValid = false;
}
args.IsValid = _lastValid.Value;
}
沒有留言:
張貼留言