页面修改成套用MasterPage时遇到Invalid postback or callback argument的错误
这两天修改以前页面的时候,同时套上MasterPage,结果在几个页面上却出现了以下错误
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
网上很多朋友都提到: 在页面中添加 EnableEventValidation="false" ,但是,就我目前遇到的情况应该不是这样
仔细看了一下aspx页面的代码,原来是粗心所致,在去掉原页面的<Page>,<Body>等的时候在文件末端还留下了一个</form>没删掉.就造成了以上问题.
所以,不能粗心啊!!!!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步