tags:

views:

375

answers:

3

I have one aspx page that has two UserControls on it; each is primarily a ModalPopupExtender. One has validators; one does not. The one that does not has a Submit button with the CausesValidation="false" attribute on it.

When that Submit button is clicked, nothing happens. Click it again, and the postback happens as expected. There is clearly some validation issue going on here, because if I remove all validators from the page, the postback succeeds on the first click.

What's going on here?

+1  A: 

Without seeing the code, I can't say this for certain, but it sounds like you may need to utilize the validation groups. The validation group would be set on the validation components as well as the button that posts back the page.

RSolberg
Validation groups don't make a difference. I am glad of this because validation groups shouldn't be meaningful on a control that has "CausesValidation=false" on it.
Ben Fulton
Good call, w/o seeing the rest of the code, it'll be hard to diagnose...
RSolberg
A: 

Make sure that the buttons that show the ModalPopups are marked CausesValidation=false as well. What was happening was that the "Show Dialog" button for the non-validating dialog was not marked this way; this was causing the entire page to validate when that dialog was shown - including the other dialog, which did have validation and was failing it. This caused the Submit button to fail for apparently no reason.

Moral of the story: Make sure to use CausesValidation on any buttons that don't require it, and use Validation Groups to separate out various page parts, especially when parts of the page are not visible.

Ben Fulton
A: 

Have you tried removing the OK button property from the modal popup?

BenB