Joe
Joe

Reputation:

Does the page load event still fire if a control is inside an update panel?

I have a page with part of a listview control inside an update panel. When a button is clicked in the listview I modify some data and call this.databind to refresh the data. It appears that the page load event is still firing even though the control is inside an update panel. I am wondering why the page load event is firing? Is it due to calling this.databind on the listview_onitemcommand event?

Upvotes: 1

Views: 2794

Answers (2)

Cyril Gupta
Cyril Gupta

Reputation: 13723

If you wish to get rid of the UpdatePanel, I recommend reading this article

I think getting rid of the UpdatePanel was the most wonderful Ajax decision I ever made.

Upvotes: -2

Rex M
Rex M

Reputation: 144202

An UpdatePanel invokes an entire request lifecycle on the server. It is exactly the same as if you'd clicked the button in a normal synchronous page. OnInit, OnLoad, Click_Handler, and Render all execute. The entire page is rendered to HTML and sent back to the browser through the AJAX call of the UpdatePanel. The only difference is that when the UpdatePanel receives the results (the entire HTML output of your page, like normal) it slices out just the part relevant to itself and replaces the DOM with that HTML, and throws the rest away. (It also updates/replaces the ViewState)

Upvotes: 5

Related Questions