Monday 24 February 2014

Enableeventvalidation in asp.net

This feature eases the threat of unauthorized or nasty postback requests and callbacks. It is strongly suggested that you do not disable event validation.

Invalid postback or callback argument.  Event validation is enabled using. It don’t allow the user to insert the malicious data to post into browser;

 <%@ Page   enableEventValidation="true"  %>

By marking as EnableEventValidation= false ; any post back event like drop down or Button submit it won’t check the malicious data or Html encoded data.

Disabling the EnableEventValidation by below code;

   <%@ Page   enableEventValidation="false"  %>
You can do and assign the enableEventvalidation from code behind also like below code


protected void Page_Init(object sender, EventArgs e)
        {
            Page.EnableEventValidation = false;
        }


Enabling event validation for whole application by setting the enableEventvalidation=false in

web.config file by;
<system.web>
    <pages  enableEventValidation="false">
     </pages>
    </system.web>

No comments:

Post a Comment