Click here to Skip to main content
15,891,761 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey,

I just want to know how to call java script or server side code when an update panel is introduced.

It's working when Ajax is not used as i used ajax in that part i don't get my output as i want.

And if row is selected in grid view the whole page get's refreshed. Please also suggest me how i can avoid refreshing the entire page when a row is selected...!!

Thanks in advance
Posted

1 solution

Refer - ASP.NET - UpdatePanel and JavaScript[^].
Quote:

Yes:


C#
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);

And then:


JavaScript
function endRequestHandler(sender, args)
{
  // Do stuff
}

Documentation here and here. Keep in mind that this will fire for every AJAX request on the page.



More - [MSDN] Programming UpdateProgress Controls in Client Script[^].
 
Share this answer
 
Comments
jkirkerx 7-Aug-13 15:24pm    
You may have to adjust the script manager, I think the above solution requires
PartialPageRendering = true

And in the Update Panel
Children as Triggers = False
UpdateMode = Condtional
Hi jkirkerx,

Thanks for the comment.

But I have done this without these properties in one project previously. And it works fine.

Thanks,
Tadit
jkirkerx 8-Aug-13 12:28pm    
The comment direct towards the OP, not you. It was just meant as a reminder to the op to check his Script Manager Settings and Update Panel Settings.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900