开发者

How to initiate JavaScript Callback with MVC2 using RenderAction

开发者 https://www.devze.com 2022-12-24 23:14 出处:网络
I am building a dashboard where I am iterating through a list of controls to render, and I need to initiate a general callback both after each control and after they are all completed.I was curious wh

I am building a dashboard where I am iterating through a list of controls to render, and I need to initiate a general callback both after each control and after they are all completed. I was curious what the best way to handle this is. I can get the control specific callback fire开发者_如何转开发d off by placing myUserControlCallback(); in the user control itself. I'm just not sure how to run something like allControlsRendered();.

Any ideas?


If you know how many widgets there are you can put a counter inside myUserControlCallback() and count the invocations. When number of invocations reaches number of widgets you know that the current call is last and you can now call allControlsRendered().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号