User control updatepanel not updating

NET AJAX / Update Panel aren’t working…” – this is probably the number one complaint/question found on the ASP. I decided it would probably be a good idea to discuss some of the common issues I’ve seen: Well, while this isn’t a complete list of problems that you may find, hopefully it sums up about 90% of them out there.

In addition to these issues, I know users have problems with Update Panel Triggers, User Controls in Update Panels, and Update Panels in Master Pages. NET AJAX docs to become familiar with the controls.

User control updatepanel not updating

Also, check out the AJAX Videos which discuss usage of not only the Update Panel but also the AJAX Control Toolkit.

This thing is quite simple when we are trying to update any control which is inside the updatepanel itself. We have one Button say Button1, which is also inside the Update Panel.

But, The problem may come when we want to update the controls which are outside of Update Panel and we need to update the same while updating then control inside updatepanel. Now, our requirement is to update the Label2 while we are updating Label1 by Clicking Button1.

Lable1 present inside the update Panle and Label2 is in the outside of update Panel.

If we click on Button1 now, it will update the text of Label1, but though we have registered the Label2 with the script manager still its value will not be reflect. After that we have set the Control Value by from the data item collection using .

So, In case we have multiple control that we need to update we can use the control name to retrieve the value form the Controldata Items.

NET Ajax, but even looking around a lot I didn't find a clean and polished solution for what should be a common task. NET Ajax extender for such a simple task, but after a few hours of Google-ing, I found a few nice articles on Ben Rush's blog, which is a very valuable source of knowledge on the internals of ASP. The only thing you need to do to refresh from javascript is to register a Button (hidden via CSS) Click event as async trigger for an Update Panal and then call the following method from your javascript method: Yes, that easy. But in my page I also had to pass a value to the Update Panel, so the button was not enough.

So I adapted a bit Ben's solution, and I add hidden text box, and update its value before calling the do Post Back method.

We do not want the Update Panel to Update all the time (hijack all Post Backs), so we set this to Conditional.

We also do not want to specify the child controls of the Update Panel as triggers, causing it to update, also.

NET, we are able to programmatically force an Update Panel to Update – we do not have to rely solely on triggers.

Tags: , ,