This is a migrated thread and some comments may be shown as answers.

Do I need to remove event handlers?

1 Answer 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gunnar
Top achievements
Rank 1
Gunnar asked on 21 Jan 2009, 07:06 AM
Hi,

I have a general question about event handlers and memory cleanup regarding all of your controls.

When I add an event handler, lets say I'm doing "tooltip.add_hide(...)" (Telerik.Web.UI.RadToolTip control).

Do I need do remove that handler (tooltip.remove_hide(...)) or is that taken care of by the ToolTip control itself?
Or do the ASP.NET AJAX Framework handle these things?

Regards

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 22 Jan 2009, 02:10 PM
Hello Gunnar,

When attaching handlers to the RadToolTip control in particular, their removal depends on the exact element you have attached the handler to (the tooltip contains more than 1 element and has a complex HTML). At some points in its code the $clearHandlers method is used and as you know it clears all the attached handlers. However, the best practice is to remove the handlers when you attach such by using the remove_handler syntax and that is what I advise you to do.

Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Gunnar
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or