views:

22

answers:

1

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.

A: 

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.

TheGeekYouNeed
The custom control looks like a good solution. However, my website currently have a bunch of controls so it's really difficult to choose this solution.Thanks very much!
nguyen190887