Today's new discovery: There is something to note when using event verification in Ajax.
Source: Internet
Author: User
Working today is still aimed at Ajax applications of the company's projects, because this technology is not used by two colleagues in the company, and the technology is not very mature, I dare not apply everything to the project. I can only change everything in one place and place. I will do most of the work, so I should be very careful, otherwise, the result is ..... I don't know. I only know that it is very serious. newegg people are watching a website for dinner. ^ _ ^, a problem found today, based on the error message:
BackThe sending 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. The reason is that there is a problem with the setting of this node. It is good to set it to false. The purpose of checking this node is to verify the event. I understand, for example, if a button-based click event is used to determine whether a condition is not met, return is returned. In this way, the event is verified. If such an event exists, modify the configuration file in the configuration file: <pages enableeventvalidation = "false">
Because the default value is pages enableeventvalidation = "true">. this node I think Microsoft should set it to pages enableeventvalidation = "false"> when we create an Ajax project, so that we do not need to set it. of course, this is actually useful. We need to set it in the project according to the actual situation. I have also tried a few places, I don't know whether it is because of the version of vs or why sometimes the error will not be reported. I also found that the page used in the previous project. registerstartupscript ("successmsg", "alert ()"); the method cannot be passed in the current Ajax project. scriptmanager is required. registerstartupscript (button1, this. getType (), "successmsg", "alert ('success ') ;", True); note that the red block on the Left cannot be dropped. Otherwise, an error is reported ., I can't laugh at it today. I miss my wife, I miss it.
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