views:

215

answers:

2

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?

+4  A: 
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

Jeeva S
I think i might just stick with disabling EventValidation for each of the buttons.
Jack Marchetti
yeah.. that would better idea i guess
Jeeva S
perhaps just poor design on my part by putting a Modal Form with Event Validation. Perhaps I'll get rid of the asp.net validators and just do it in the code behind.
Jack Marchetti
+2  A: 

Try the Page.EnableEventValidation property:

http://msdn.microsoft.com/en-us/library/system.web.ui.page.enableeventvalidation%28VS.80%29.aspx

IrishChieftain