In. net, the problem of sending back or callback parameters being invalid is solved.

Source: Internet
Author: User
The error details are as follows:
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. So far, there are two situations:
First, form nesting. One page can only have one form. Check carefully. Code You can solve this problem.
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 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.

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.
The second is to use JavaScript to change the content (such as Ajax) in the drop-down menu, which is common in the provincial/municipal linkage menu. This error is prompted when an event is returned.
This error occurs only in vs 2.0. If you change enableeventvalidation = "true" to enableeventvalidation = "false", the error will not occur, but the value of this item cannot be read in the code.
In the first case, the form cannot be embedded in the form.
In the second case, the solution is to change the control to HTML control, and the control carries runat = "server"
For example, here is a solution for me.
Chain Effect of a province and city
Save
<Asp: dropdownlist id = "dropdownlist3" runat = "server" onchange = "changelocation (dropdownlist3.options [dropdownlist3.selectedindex]. Value)">
</ASP: dropdownlist>
City
<Select name = "ddlcity" id = "ddlcity" runat = "server">
<Option value = "0" >=select = </option>
</SELECT>
Then, use request. Form ["ddlcity"]; In the backend CS code to receive the value of the city.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.