Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题很简单,
我可以使用从客户端 更改__EVENTTARGET的值
document.forms.ParentForm.__EVENTTARGET.value = "";
但是如何从服务器端做到这一点。
您不能直接修改它,但您可以在 Page_Load 中执行以下操作:
Server.Transfer(String.Format(Request.Path + "?__EVENTTARGET={0}", "some_control_id"), true);
尝试这个-
Request.Form["__EVENTTARGET"] = "";