Disable Event Validation

Posted by Community Admin on 03-Aug-2018 23:16

Disable Event Validation

All Replies

Posted by Community Admin on 01-Dec-2010 00:00

How do I disable event validation in 4.0 RC?  I've tried setting it on the <pages> element in web.config but it did not seem to work.


Thanks,
Matt

Posted by Community Admin on 01-Dec-2010 00:00

Hi Matt,

You can do this only programmatically. There is no UI that allows you to set this property.

App.WorkWith().Pages()
          .LocatedIn(PageLocation.Frontend)
          .ForEach(pg => pg.Page.EnableEventValidation = false)
          .SaveChanges();


Best wishes,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Dec-2010 00:00

Ivan,
Any suggestions for where to put this code to make it work?
I ended up going direct to the database, which did work, but probably not the ideal approach.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 


            
Line 19:             App.WorkWith().Pages()
Line 20:                       .LocatedIn(PageLocation.Frontend)
Line 21:                       .ForEach(pg => pg.Page.EnableEventValidation = false)
Line 22:                       .SaveChanges();

Here's my DB update...  see any major problems with this approach?
update sf_page_data set enable_event_validation = 0

Thanks,
Matt

Posted by Community Admin on 03-Dec-2010 00:00

Hello Matt,

You can put it in a user control and trigger it with a button. You are getting a null reference exception and most probably pg.Page is null. This could happen if the page in the query is a Group page. The Group page does not have a PageData which is represented by .Page.

I do not suggest working with the database and touching any tables there. All data is controlled by Open Access ORM and changes to the database are made in case of some issues that cannot be resolved by the API or you need to get some data just to use it on another place.

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed