Reputation: 34208
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
Upvotes: 0
Views: 1795
Reputation: 6406
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.
Upvotes: 1