I would be the first to tell you that "All input is evil until proven otherwise." However, in this case, I think your friend is mistaken because by his/her logic we could probably come up with a hundred other properties that should be checked or set, even though the defaults are okay.
Checking Page.IsValid
only makes sense if you have a "CausesValidation" scenario - a button that submitted the form has its CausesValidation
property set to True. This would automatically call Page.Validate
and all Validation controls belonging to the same ValidationGroup
would be checked for validity.
Edit:
Just checked it using Reflector and the function will always return True if the Page does not have any Validators(ValidatorCollection is null).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…