locked
How to set <pages enableEventValidation="true"/> in Master page

    Question

  • How can I  put <pages enableEventValidation="false">  in my master page. But it is possible to put <pages enableEventValidation="false"> in content pages.

    I got an error ::System.Web.HttpUnhandledException: Exception of type
     'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentException: Invalid postback or callback
     argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration
      or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that
      arguments to postback or callback events originate from the server control that originally rendered them.
       If the data is valid and expected, use the ClientScriptManager.
     RegisterForEventValidation method in order to register the postback or callback data for validation.
       at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
       at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
       at System.Web.UI.WebControls.Calendar.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.Calendar.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent


    Arun PS
    Friday, November 11, 2011 6:21 AM

Answers

  • Hello Arun,

    Welcome to the MSDN forum.

    For ASP.Net issue, I would suggest you to post it to the ASP.net categories for more efficient responses.

                    ASP.NET Forums : The Official Microsoft ASP.NET Forums

    In addition, we can put <pages></ pages> to the web config file and use its masterPageFile property to set the site master pages’ enableEventValidation. The following is a code block for your reference:

     

    <system.web>
        <pages buffer="true"
             masterPageFile = "~/Site.master"
             enableEventValidation="false">
        </pages>
      </system.web>
    

    And the idea is coming from the MSND library at this link:

                    pages element

    Hope it helps.


    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us
    Monday, November 14, 2011 3:37 AM

All replies

  • Hello Arun,

    Welcome to the MSDN forum.

    For ASP.Net issue, I would suggest you to post it to the ASP.net categories for more efficient responses.

                    ASP.NET Forums : The Official Microsoft ASP.NET Forums

    In addition, we can put <pages></ pages> to the web config file and use its masterPageFile property to set the site master pages’ enableEventValidation. The following is a code block for your reference:

     

    <system.web>
        <pages buffer="true"
             masterPageFile = "~/Site.master"
             enableEventValidation="false">
        </pages>
      </system.web>
    

    And the idea is coming from the MSND library at this link:

                    pages element

    Hope it helps.


    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us
    Monday, November 14, 2011 3:37 AM
  • http://msdn.microsoft.com/en-us/library/950xf363.aspx
    Saturday, February 04, 2012 8:46 AM