I use CustomValidate to check för "<" in the beginning of text entered into few text boxes. It goes just fine, as long as the user deletes the potentially dangerous sign and updates the page. But if the user choses to break the update and instead press Exit button, the unpleasant error page is shown, [HttpRequestValidationException (0x80004005). The error message states that a “potentially dangerous Request.Form value was detected…” I don't want to rewrite the validation, as date and e-mail validators are really good. Is there any way to avoid the error page showing up? I did put CausesValidation="False" on my Exit button but in this case it does not help. Help is needed quickly, I haven't much time, so if anyone knows a remedy, answer PLEASE!

Recommended Answers

All 2 Replies

its not the button you would turn validation off . its on the textbox.
or you can put ValidateRequest="false" also at the top of your page, to turn off validation on everything

I use CustomValidate to check för "<" in the beginning of text entered into few text boxes. It goes just fine, as long as the user deletes the potentially dangerous sign and updates the page. But if the user choses to break the update and instead press Exit button, the unpleasant error page is shown, [HttpRequestValidationException (0x80004005). The error message states that a “potentially dangerous Request.Form value was detected…” I don't want to rewrite the validation, as date and e-mail validators are really good. Is there any way to avoid the error page showing up? I did put CausesValidation="False" on my Exit button but in this case it does not help. Help is needed quickly, I haven't much time, so if anyone knows a remedy, answer PLEASE!

I didn't know it's possible to turn of a validation on a user control when there is validation on other controls. I'll check it right away., thank You for the tip. Don't want to turn it off for the whole page, as it wouldn't check the other field. Anyway, I resolved it by stopping the user from keying "<" into the textboxes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.