C # solution to the error message returned when the callback parameter is invalid
Suddenly an error occurs: "The Callback or callback parameter is invalid. Use in 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 sending back or callback data for verification.
Solution:
If the data binding control is used on the page, bind the data
If (! Ispostback)
{
Datainit ();
}
If not, set the enableeventvalidation attribute on the page to false.
<% @ Page language = "c #" autoeventwireup = "true" codebehind = "localuser. asp tutorial x. cs "inherits =" sklgp. workstation. web. page. mainframe. manage. localuser "enableeventvalidation =" false "%>
Other solutions with the error "sending back or invalid callback parameters"
Error Description: the error message returned or 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 sending back or callback data for verification.
Note: an unhandled exception occurs during the execution of the current web request. Check the stack trace information for details about the error and the source of the error in the code.
Error cause:
1 is form nesting. A page can only have one form. You can solve this problem by checking the code carefully.
2. Use webpage special effects to change the content (such as ajax) in the drop-down menu)
Solution:
For errors caused by the first reason, you only need to ensure that the page has only one form.
For errors caused by the second reason, you need to change the dropdownlist control to the html select control.
When implementing the cascade menu, an error suddenly occurs. Other solutions
Solution:
You can replace the dropdownlist control with select when you perform the cascade menu, for example:
Ui -->
<Asp: dropdownlist id = "ddlcity" runat = "server">
</Asp: dropdownlist>
C # -->
String cityname = this. ddcity. selecteditemvalue;
Replace:
Ui -->
<Select id = "ddlcity" runat = "server">
</Select>
C #->
String cityname = request [this. ddlcity. uniqueid]
4. The value attribute of the listitem in the dropdownlist control contains Chinese characters. You only need to change the value to English or numbers.