Showing posts with label fires. Show all posts
Showing posts with label fires. Show all posts

Wednesday, March 28, 2012

How do I wire a javascript function to an update panel so it fires when the panel is updat

I have a list of location in an update panel and a virtual earth map w/ pushpin's representing each of the locations. My update panel works great for paging through the location list using some custom paging where a the panel updates when the paging buttons are clicked. What I'd like to be able to do though is wire up an event handler to the update panel so when it refreshes, my javascript function can make a page method call and get new set of pushpins to display on the virtual earth map.

a) How do I get a reference to the update panel in javascript?

b) What is the update panel event that I wire a call back method to?

Thanks!

Hi there, you can accomplish this by hooking up a client side event handler to the PageRequestManager pageLoading event. The event args will indicate the list of UpdatePanels that are getting refreshed, you can inspec the array and if the UpdatePanel that you are interested in is being refreshed call your function.

More info here:http://ajax.asp.net/docs/tutorials/usingMsAjaxLibrary/default.aspx

Thanks,
Federico


Federico,

Thanks for the reply. Because the ASP.NET forums are moderated, I literally just figured it out before receiveing your reply. The PageRequestManager in Beta 1 is awesome!

- James


Hi Frederico

Your link appears to be broken - do you happen to know a working link for this topic ?

Thanks,
Richard

Wednesday, March 21, 2012

How can I reload all UserControls when the event fires in one of them(.ASCX) ( inside the

I have 3 UserControls on a page inside the same UpdatePanel.
When the event fires in one them (Voting control), both others should be updated(blocked for user = 'Disabled').
How should I reload those other UserControls? They are reloaded only after the whole Page is reloaded, so the data are lost by this moment

Hello,

In your code-behind, first remove the controls and then add them, But if you can better explain a bit more what you wanna do, we can help more.

But if your user controls are inside updatepanel only thing which will update is what you changing from code behind. So are you changing other user controls from code behind ??