I have a parent page with two data controls. I want to be able to open a child window, do something on it, and when it closes I want to rebind only one of the two data controls on the parent page. I have the control I want to update within an UpdatePanel so would like to call rebind it and call UpdatePanel.Update().
Share
From a child window, you can’t actually “call” a server side function for the parent page, however you can use some javascript to invoke client side functions on that page.
On the parent page:
On the child page:
In the example you provided, in particular where you have an UpdatePanel, you’ve actually left yourself a few options here. If the UpdatePanel is set with some form of trigger to force it to update, be it all children or just specified ones, in your parent function you can force a postback on one of those controls. Ultimately, the parent pages javascript function should have some form of a __doPostBack() call, referencing the id of a control and some (empty) parameter, however you’d probably be better off generating that javascript with codebehind via:
Once you put that together, it’s all a matter of tying the actual invocation to whatever client side event you want on your child page, be it onUnLoad() or in some custom function you call.