Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
166
rated 0 times [  170] [ 4]  / answers: 1 / hits: 84645  / 15 Years ago, mon, july 27, 2009, 12:00:00

I have a pageLoad function that sets some CSS on a .ascx control that I cannot change. On page load everything is fine, but when an update panel updates the control, my CSS is no longer applied. How can I rerun my function after the page updates?


 $(function() {
$("textarea").attr("cols", "30");
$("input.tbMarker").css({ "width": "100px" }).attr("cols","25");
});

This obviously only runs on the initial page load. How can I run it after an update?


More From » asp.net

 Answers
42

Adding an add_pageLoaded handler can also work.



Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(PageLoadedHandler);


Note: the handler will fire for any callback, but you can use sender._postBackSettings.panelID to filter when you want your function called.



More samples:




[#99046] Wednesday, July 22, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elishaannac

Total Points: 28
Total Questions: 97
Total Answers: 101

Location: Samoa
Member since Mon, Nov 8, 2021
3 Years ago
elishaannac questions
Sun, Dec 5, 21, 00:00, 3 Years ago
Mon, Jun 14, 21, 00:00, 3 Years ago
Mon, Jul 22, 19, 00:00, 5 Years ago
Mon, Jul 8, 19, 00:00, 5 Years ago
;