How to initiate JavaScript Callback with MVC2 using RenderAction
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();
.
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()
.
精彩评论