How can I identify which controls are updated in UpdatePanel?
I have a UserControl (UC) which is in an UpdatePanel. When the UC is loaded, I run a recursive method to set tooltip for all Button, LinkButton, and DropDownList in this UC. The problem is sometimes I only update 1 control in the UC such as a DropDownList, but I have to call the recursive method on all controls of the开发者_运维百科 UC. I was wondering whether there is any way to identify which controls is updated in the UpdatePanel so that I can update correctly these controls.
Hope to receive an answer soon!
Many thanks.
You can extend each of the server controls, essentially making a custom control for each control, and add a property called, for example IsDirty.
During the change event of the control, you could set this property to true, then run through your method at sets tooltips, and reset all the control's IsDirty property from true to false after your processing is complete.
精彩评论