Why is my Button doing an asynchronous postback?

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.
 
G

Gaurav Vaish \(a.k.a. MasterGaurav\)

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top