AutoPostback and validators
From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 07/26/04
- Next message: Guoqi Zheng: "Re: Document Outline in VS.NET! WOW!"
- Previous message: wl: "Re: Cookies"
- Next in thread: Cowboy \(Gregory A. Beamer\) [MVP]: "Re: AutoPostback and validators"
- Reply: Cowboy \(Gregory A. Beamer\) [MVP]: "Re: AutoPostback and validators"
- Reply: bruce barker: "Re: AutoPostback and validators"
- Reply: Hans Kesting: "Re: AutoPostback and validators"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Jul 2004 12:02:42 +0200
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
- Next message: Guoqi Zheng: "Re: Document Outline in VS.NET! WOW!"
- Previous message: wl: "Re: Cookies"
- Next in thread: Cowboy \(Gregory A. Beamer\) [MVP]: "Re: AutoPostback and validators"
- Reply: Cowboy \(Gregory A. Beamer\) [MVP]: "Re: AutoPostback and validators"
- Reply: bruce barker: "Re: AutoPostback and validators"
- Reply: Hans Kesting: "Re: AutoPostback and validators"
- Messages sorted by: [ date ] [ thread ]