1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Disable Event Validation

Disable Event Validation

4 posts, 0 answered
  1. Matt
    Matt avatar
    56 posts
    Registered:
    20 Nov 2009
    01 Dec 2010
    Link to this post
    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

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Dec 2010
    Link to this post
    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
  3. Matt
    Matt avatar
    56 posts
    Registered:
    20 Nov 2009
    02 Dec 2010
    Link to this post
    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

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Dec 2010
    Link to this post
    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
4 posts, 0 answered