The callback parameter is invalid. Use <pages enableeventvalidation = "true"/> in the configuration, or use <% @ page enableeventvalidation = "true" %> On the page to enable event verification. For security purposes, this function verifies whether the parameters of the send-back or callback events come from the server controls that initially present these events. If the data is valid and is expected, use the clientscriptmanager. registerforeventvalidation method to register the resend or callback data for verification.
1.Cause:If you directly use databind () in pageload, When you activate the event of embedding controls in the gridview, PostBack is triggered, however, you did not judge whether the data binding at this time is still the first execution of pageload's datebind (). However, you have triggered events such as updates and deletions, in this case, the above error "verify whether the parameters of the send-back or callback events are derived from the server control that originally presented these events" is generated.
2.Solution:Write the binding statement in! In ispostback,
Protected void page_load (Object sender, eventargs E)
{
If (! Ispostback)
{
// Data binding statement
}
}
3.Ispostback:
indicates whether the current request is opened for the first time. page. ispostback or ispostback or This. ispostback or This. page. ispostback , which are equivalent.
1) It is the first time that a URL is opened through the address bar of IE, when you submit a server by clicking the submit button on the page or the button that can cause the request to be submitted in post mode, the page is no longer opened for the first time. (Each click is loaded once)
2) ispostback is only available in for the first time , the value is false. For other times, the value is true.
3 ). net: request. form. count> 0
4) when loading a page, set put the code to ispostback each time, you only need to load the code once in if (! Ispostback.
5) The ispostback attribute is triggered every time the user returns any information from the server to determine whether the user is No Logon events or other events
6)
If (! Ispostback) // only when it is enabled for the first time,
{
response. write ("first submission! ");
}
If (ispostback)
{
response. write ("click the button! ");
}