views:

89

answers:

2

I have cause validation true on button. And I am checking the Page.IsValid in c# code. But its always returning false value?

A: 

Have you called Page.Validate before you check its valid state?

Tim Schmelter
No I did not called Page.validate.
sathish
Can you provide me some code.@sashaeve , I need to have causevalidation true.
sathish
You have to call Page.Validate always befor you check if page.isValid.
Tim Schmelter
A: 

If your button has CauseValidation = "true" and you have some another required controls the behaviour is expected. Try to set CauseValidation = "false" or check ValidationGroup property of button and associated controls (explanation).

sashaeve
Can you provide me some sample code?
sathish
I've added a link with validation group behavior explanation.
sashaeve