Avatar of Vic-20
Vic-20
Flag for Australia asked on

Can an ASP Callback make an UpdatePanel update

Hi

Following on from an earlier question "ASP UpdatePanels not working together" I have another question as posed by the title "Can an ASP Callback make an UpdatePanel update"

ie, can a callback be initiated, change values server-side and update the controls on the updatepanel with the new values. Obviously, this goes beyond simple passing of some text back to the client callback method so please don't suggest that.

Thanks
ASP.NET

Avatar of undefined
Last Comment
Vic-20

8/22/2022 - Mon
Rouchie

Yes.  Put your link (must be a linkbutton) inside an update panel of its own, then for both updatepanel's set:
 
ChildrenAsTriggers = False
UpdateMode = Conditional

Then in code behind, in the LinkButtonID.Command or LinkButtonId.Click event, make your changes to the variables/contents then call the Update method on both updatepanels.
Vic-20

ASKER
Thanks, but as explained in the link for question "ASP UpdatePanels not working together" this will not (and does not, I've tried anyway) work since the design of UpdatePanels results in the last update cancelling any that went before.

ie, this does not work:

 protected void Button1_Click(object sender, EventArgs e)
 {
   Thread.Sleep(2000);
   LabelCounter.Text = DateTime.Now.ToString();
   UP1.Update();
   UP2.Update();
  }

protected void Button2_Click(object sender, EventArgs e)
{
  Thread.Sleep(4000);
  LabelCounter2.Text = DateTime.Now.ToString();
  UP1.Update();
  UP2.Update();
}
ASKER CERTIFIED SOLUTION
Rouchie

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Vic-20

ASKER
Thanks for the links. Will wait for release of 4.5 obviously, and look further but for now to answer your question:
Pretend I have 2 grids, each on an update panel and each requiring some time to refresh. It would be nice if the 1st grid could be refreshed and while that is busy, work on grid 2 and maybe refresh it if need be. It could even be a save - the point is the same: have the 2 grids on their own panels working independently, asynchronously would be great.

Do you think this is possible or something that has to wait for .net 4.5?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
SOLUTION
Rouchie

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Vic-20

ASKER
Yeah, it seems I have Async requirements not provided for by an UpdatePanel so I'll wait for 4.5.
Thanks for the tips on improving grid performance - I'll definitely keep the ideas for another day.
Vic-20

ASKER
Provided understanding of what's possible with other tips