Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to disable Event Validation for an entire page?

I have a nested user control which appears on every single page. It contains some validation in the form of ASP.NET validators.

The problem I'm running into is, since it's on every page (in essence it's located in my left navigation control), I need to set CausesValidation="false" on every single button etc..

Is there a way to set CausesValidation="false" at the Page Level?

like image 616
Jack Marchetti Avatar asked Nov 03 '09 18:11

Jack Marchetti


People also ask

How do I turn off client-side validation?

To disable client-side validation, set the page's ClientTarget property to 'Downlevel' ('Uplevel' forces client-side validation). Alternatively, you can set an individual validator control's EnableClientScript property to 'false' to disable client-side validation for that specific control.

What is event validation?

Event Validation is a new feature in ASP.NET 2.0 which provides an additional level of checks on postback actions. It verifies whether a postback from a control on client-side is really from that control and not from a malicious person trying to break your application.


1 Answers

Page.EnableEventValidation   = false;

It is strongly recommended that you do not disable event validation. If you do disable event validation, make sure that no postback could be constructed that could have an unintended effect on your application.

http://msdn.microsoft.com/en-us/library/system.web.ui.page.enableeventvalidation.aspx

like image 84
Jeeva Subburaj Avatar answered Oct 07 '22 03:10

Jeeva Subburaj