During the two-day development, I encountered a problem: an error was reported when I used the server button event after the Ajax linkage drop-down box:
The callback parameter is invalid. Use in configuration
Or enable event verification on the page. 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 sending back or callback data for verification.
After checking on the Internet, the general explanation for this error is:
So far, there are two situations:
First, form nesting. A page can only have one form. You can solve this problem by checking the code carefully.
Second, Ajax is used in the drop-down menu, which is common in the provincial/municipal linkage menu. It may be because the initial item value of the drop-down menu is assigned to the ASPX page. This error is prompted when the event is returned, delete the initial item value from the drop-down menu and add the item to the binding event.
The solution is as follows:
In the subsequent code, use request. Form ["ddlcity"]; To obtain the value of the dropdownlist, instead of ddlcity. selectedvalue. The general reason is that AJAX changes the page content. The control value in the page content sent back to the server is no longer normal and can only be obtained through the original method.
This result is inconvenient. In addition, when the page is sent to the client again, the content of the dropdownlist control is disordered, And the Ajax advantage is lost. You need to reset the dropownlist content on the server side based on the transmitted information. There is no perfect solution yet.
I have never tried Microsoft's Ajax. I don't know if the same problem exists. I think it should be none.