Why is my Button doing an asynchronous postback?

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have a Page that contains an UpdatePanel with a Button inside of it. The
UpdatePanel has ChildrenAsTriggers="false" and UpdateMode="Conditional", and
the Button is not one of the Triggers, so I would expect clicking this
Button to do a normal postback. However, when I click it, the browser does
not do a postback, although it does execute the eventhandler for the button.
What could I be missing? Thanks.
 
Nathan Sokalski said:
I have a Page that contains an UpdatePanel with a Button inside of it. The
UpdatePanel has ChildrenAsTriggers="false" and UpdateMode="Conditional",
and the Button is not one of the Triggers, so I would expect clicking this


The postback will always happen (async).
It's just that the UpdatePanel contents will not be updated.


Read:
http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_UpdatePanel_ChildrenAsTriggers.aspx

[snippet]
Child controls of nested UpdatePanel controls will not cause an update of
the parent UpdatePanel control's content unless you call the Update() method
explicitly or you define the child controls as triggers.
[/snippet]

[snippet]
A scenario where you might set ChildrenAsTriggers to false is when you have
two UpdatePanel controls and you want a postback from the first panel to
update the content of the second panel but not update its own content. For
example, the first panel might be a list of products to buy and the second
panel might be a shopping cart.
[/snippet]
 
Back
Top