Partial postback and update panel problem

i have one label out of update panel and one button inside update panel. in button click event i update the label text. when i run the code and click on button then partial postback occur and button click event fire but label value is not change. if i put the label too in the update panel then label value change at the time of button click. i do not understand why label value is not getting updated. suppose if i want that label should stay out of update panel and label value should change at the time of partial postback then how to write the code. i dont want put the label in any update panel. please guide me with small sample working code.

thanks

Answers


As far as I know, it is the controls that you want to update asynchronously - in your example the label - which need to be put into the UpdatePanel. The Button control is the one that you don't need to put into the UpdatePanel, because you can use a Trigger element nested inside the UpdatePanel to specify what control will trigger the asynchronous postback for this UpdatePanel.

So, in short, you have to put the label inside the UpdatePanel.

You can read more about the UpdatePanel on the MSDN page for it.


Need Your Help

ASP .NET MVC3 ajax call same function from various pages

c# ajax asp.net-mvc-3

How can I call the same action using ajax from different pages?

java.lang.OutOfMemoryError with DOM

java xml dom testing

I am trying to test different parsers, i have problem with DOM when i try to parse 70 MB xml file. Error is java.lang.OutOfMemoryError