H
Hans Kesting
Hi,
I have a pulldown with both AutoPostback set to true and a validator.
When I select an "invalid" value from the pulldown, the validator message
shows briefly, then a postback occurs and the errormessage is gone!
Why doesn't the validator prevent autopostback (or can I set something so
that it *will* prevent postback)?
Background:
The pulldown contains "groupheaders" and "groupitems". The user should only
select groupitems, so I use a validator to prevent headers from being selected.
First I used a RequiredFieldValidator (all "headers" had a value "--", which was
also set as "InitialValue" for the validator), then a CompareValidator ("headers"
changed to negative values and the validator checked for positive value).
Both did block when I clicked the "save" button. Neither prevented the
postback so the error flashed briefly before being removed.
Checking for "IsValid" (either on Page or on the validator) has no effect,
it's the postback itself that causes the message to disappear.
Is there someway to prevent the postback if the validator fails, or retain the
validator message after postback?
Hans Kesting
I have a pulldown with both AutoPostback set to true and a validator.
When I select an "invalid" value from the pulldown, the validator message
shows briefly, then a postback occurs and the errormessage is gone!
Why doesn't the validator prevent autopostback (or can I set something so
that it *will* prevent postback)?
Background:
The pulldown contains "groupheaders" and "groupitems". The user should only
select groupitems, so I use a validator to prevent headers from being selected.
First I used a RequiredFieldValidator (all "headers" had a value "--", which was
also set as "InitialValue" for the validator), then a CompareValidator ("headers"
changed to negative values and the validator checked for positive value).
Both did block when I clicked the "save" button. Neither prevented the
postback so the error flashed briefly before being removed.
Checking for "IsValid" (either on Page or on the validator) has no effect,
it's the postback itself that causes the message to disappear.
Is there someway to prevent the postback if the validator fails, or retain the
validator message after postback?
Hans Kesting