Reputation: 25161
I have an updatepanel in ASP.NET that does a partial page refresh.
I've had some success using jQuery's on()
method, however $(document).ready(function(){})
is only called during the initial load of a page, rather than after each updatepanel refresh.
I think I could probably trigger it using 'ScriptManager.RegisterStartupScript()
' but would prefer a 'cleaner' method. Do any exist?
Upvotes: 3
Views: 199
Reputation: 41579
You can register an endRequest
handler using a line similar to this (in your Javascript):
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(){})
This will execute after each of your updates.
Upvotes: 2
Reputation: 148744
you should use pageLoad() function in JS
function pageLoad()
{
// put your code when returning from update panel request.
}
Upvotes: 4