Calling multiple __doPostBack from JavaScript

我与影子孤独终老i 提交于 2019-12-13 20:32:48

问题


I've got multiple UpdatePanel's on a page and i'm updating 2 of them manually by calling __doPostBack. However the problem is the first call seems to be reset when the second call is made (it never updates the panel that i requested to update first). I've got these calls wrapped in setTimeout, but it does not seem to help.

Any suggestions on how to make both calls work?


回答1:


You could probably do this on the server side of things:

UpdatePanel1.Update();
UpdatePanel2.Update();

This causes the return from the submission to contain updated information for both panels, instead of just one at a time. I believe the update panels need to be set for conditional updates however.

Also, another question, do you have the script that calls setTimeout inside the update panel? Or is it elsewhere, that may be the culprit, however I do not know off the top of my head on that one.



来源:https://stackoverflow.com/questions/360843/calling-multiple-dopostback-from-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!