Reputation: 7383
When I have a regular textbox in a UpdatePanel (not an ASP.NET control) with some JavaScript events on it, after the UpdatePanel updates my events are gone. Is there a way to re-attach my events after the update? (Preferably without putting my events inline).
Upvotes: 3
Views: 539
Reputation: 3982
The events are gone because your textbox is a new element in the DOM (after the UpdatePanel refresh). As said by korchev, use the endRequest event to re-attach the eventhandlers.
Upvotes: 0
Reputation: 30661
You can use the endRequest event of the PageRequestManager class.
Upvotes: 4
Reputation: 99957
You can have a setInterval()
loop on document load that would search for the element in the update panel and if it didn't have the events, it can re-attach them.
Upvotes: 1