Wednesday, November 24, 2010

What is EnableEventValidation

EnableEventValidation attribute is comes with Page directives. EnableEventValidation attribute accept Boolean value i.e. True or False.

When EnableEventValidation is set to True, ASP.Net application will validate the control event generated from the client UI. All ASP.Net control supports the EnableEventValidation features. For an example, If you have one dropdown list which fires page post back and it contains value 1,2 and 3. Now when user select any option then page will get post back and ASP.Net application will validate the request. If ASP.Net gets value 4 in your dropdown box (which is not exists initially) then ASP.Net application will raise the error.

EnableEventValidation have default value “True”. If you required to add some options at runtime using Javascript then you have to set EnableEventValidation=False.

You can also use “RegisterForEventValidation” when adding items at client side.

No comments:

Post a Comment

DotNet Code Guru