Hi everyone.
I think I need some help. I've been having problems with my update panel not updating when I
change for instance a label within the update panel from a server-side
button eventhandler. I've spent hours testing different things with
updatemode, childrenastriggers etc., and what have you, but nothing I do
seems to work.
So I will post some code and maybe this is obvious to some of you what I
am missing, I hope!
I am wondering if it is my collapsible panels that cause some issues? Otherwis if I remove the updatepanel it works but I would prefer if I don't have to use a postback.
Also I tried wrappen the whole thing in the updatepanel. That is all the panels inside the updatepanel but it doesn't work either.
And the code-behind: It only changes the text of a label right now but I just want the update to work. The event fires ok when I debug so that's not it. And I have already tried updatemode="always" and it doesn't update automatically when I remove the this.UpdatePanel1.Update()
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
public partial class My_CollapsiblePanels : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { Response.Write("postback"); } }
I tried it but no difference. Nothing updating in the updatepanel. Thanks for the tip though. As I understood it the Triggers option are for controls outside of the updatepanel?
The following list describes the property settings of the UpdatePanel control that determine when a panel's content is updated during partial-page rendering.
If the UpdateMode property is set to
Always, the UpdatePanel control’s content is updated on every postback that originates from anywhere on the
page. This includes asynchronous postbacks from controls that are inside other UpdatePanel controls, and postbacks from controls that are not inside
UpdatePanel controls.
If the UpdateMode property is set to
Conditional, the UpdatePanel control’s content is updated when one of the following is true:
When the postback is caused by a trigger for that UpdatePanel control.
When the UpdatePanel control is nested inside another
UpdatePanel control and the parent panel is updated.
When the ChildrenAsTriggers property is set to
true and any child control of the UpdatePanel control causes a postback. Child controls of nested
UpdatePanel controls do not cause an update to the outer
UpdatePanel control unless they are explicitly defined as triggers for the parent panel.
</div>
Chetan Sarode
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Yes, I know this. Thanks for the reminder though. I must have missed something in my code. I think I will be working with javascript and do calls to a webservice instead.
I am experiencing a similar problem to the one you wrote in your initial post. All my update panels work ok, except the one with an ajax hover menu extender. Your problem could be related to your collapsiblePanel extender, try removing this to see if you
get your button & label working (OK, it doesn't solve your problem but it might help you get closer to working out what the problem actually is)
joakim_1976
Member
8 Points
17 Posts
UpdatePanel not updating itself problem
Feb 24, 2012 05:24 PM|LINK
sushanth009
Contributor
6243 Points
1168 Posts
Re: UpdatePanel not updating itself problem
Feb 24, 2012 08:10 PM|LINK
Set the btnContent as the trigger for the Update Panel and see if it works.
joakim_1976
Member
8 Points
17 Posts
Re: UpdatePanel not updating itself problem
Feb 25, 2012 05:42 AM|LINK
I tried it but no difference. Nothing updating in the updatepanel. Thanks for the tip though. As I understood it the Triggers option are for controls outside of the updatepanel?
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: UpdatePanel not updating itself problem
Feb 27, 2012 02:25 AM|LINK
How UpdatePanel Controls Are Refreshed
<div class="subsection" xmlns="http://www.w3.org/1999/xhtml">The following list describes the property settings of the UpdatePanel control that determine when a panel's content is updated during partial-page rendering.
-
-
-
-
-
-
</div>If the UpdateMode property is set to Always, the UpdatePanel control’s content is updated on every postback that originates from anywhere on the page. This includes asynchronous postbacks from controls that are inside other UpdatePanel controls, and postbacks from controls that are not inside UpdatePanel controls.
If the UpdateMode property is set to Conditional, the UpdatePanel control’s content is updated when one of the following is true:
When the postback is caused by a trigger for that UpdatePanel control.
When you explicitly call the UpdatePanel control's Update method.
When the UpdatePanel control is nested inside another UpdatePanel control and the parent panel is updated.
When the ChildrenAsTriggers property is set to true and any child control of the UpdatePanel control causes a postback. Child controls of nested UpdatePanel controls do not cause an update to the outer UpdatePanel control unless they are explicitly defined as triggers for the parent panel.
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
joakim_1976
Member
8 Points
17 Posts
Re: UpdatePanel not updating itself problem
Mar 01, 2012 07:08 AM|LINK
Yes, I know this. Thanks for the reminder though. I must have missed something in my code. I think I will be working with javascript and do calls to a webservice instead.
hogg1980
Member
38 Points
33 Posts
Re: UpdatePanel not updating itself problem
Nov 11, 2012 03:07 PM|LINK
I am experiencing a similar problem to the one you wrote in your initial post. All my update panels work ok, except the one with an ajax hover menu extender. Your problem could be related to your collapsiblePanel extender, try removing this to see if you get your button & label working (OK, it doesn't solve your problem but it might help you get closer to working out what the problem actually is)