I thought the page would be simple, but the following error occurred during running:
For details about the page. enableeventvalidation attribute, refer to msdn to get or set a value. This value indicates whether the page verifies the send-back event or the verification callback event .. For security considerations, the Net Framework registers the sending and callback events of the server-side controls. This event verification mechanism can eliminate the risks caused by unauthorized sending requests and callbacks. With this model, the control registers its events during rendering, and then verifies these events during sending back or callback. By default, all event-driven controls in ASP. NET use this function.
First, since event verification is enabled, disable verification on the page. <% @ page enableeventvalidation = "false" %> the problem is resolved. But why is there such a problem? Google it.
If the page contains controls such as dropdownlist or ListBox, the following causes may occur:
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 is assigned to the drop-down menu on 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 reason is that the value attribute of the listitem in the dropdownlist control contains Chinese characters. You only need to change the value to English or numbers. You 'd better Add the following statement to Web. config:CopyCodeThe Code is as follows: <globalization requestencoding = "UTF-8" responseencoding = "UTF-8" Culture = "ZH-CN" uiculture = "ZH-CN"/>
Because PostBack does not use UTF-8 encoding, JavaScript will think there is a problem. Only change requestencoding = "UTF-8. If you have other suggestions, please note.