简体   繁体   English

__doPostBack on事件仅工作一次

[英]__doPostBack on event works only once

I have a hidden asp control that has a server event to it (valuechanged). 我有一个隐藏的ASP控件,该控件具有一个服务器事件(值已更改)。 I call the javascript __doPostBack method and as a parameter I send the id of the hidden control which makes it raise the valuechanged event after the Page_Load. 我调用javascript __doPostBack方法,并作为参数发送隐藏控件的ID,这使它在Page_Load之后引发valuechanged事件。 It works fine for the first time, but the other times it posts back without raising the event. 第一次运行正常,但其他时候它回发而不引发事件。 Is there anything I am missing here? 我在这里想念什么吗? Is it caching the postback? 是否缓存回发?

EDIT: 编辑:

The hidden field is in an updatepanel, so the __doPostBack doesn't refresh the whole page 隐藏字段位于updatepanel中,因此__doPostBack不会刷新整个页面

Well silly me. 好傻的我。 It won't raise the valuechanged event if you call __doPostBack on a control that its value remained the same! 如果您在控件的值保持不变的情况下调用__doPostBack,则不会引发valuechanged事件! Oopsie... Oopsie ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM