问题
I have three updatepanels in hierarchy:
UpdatePanel1--Root
UpdatePanelChild1
UpdatePanelChild2
Can I update a control in updatePanel1 on an event of the updatepanel2?
回答1:
I'm not a big fan of every updatepanel updating all the time - that seems to undo the locality update panels get you.
Another option is to specifically call the .Update() method of the OTHER update panel in your code. For example, suppose you have a button on UppdatePanelChild1 that does some processing and modifies a control in UpdatePanel2:
textBoxInsideUpdatePanel2.Text = "Updated!";
UpdatePanel2.Update();
回答2:
Yes, the easiest way is have UpdateMode="Always"
; then all update panels update regardless of whichever one triggered the postback.
来源:https://stackoverflow.com/questions/13701338/how-to-update-a-control-in-another-updatepanel