O.O
O.O

Reputation: 11307

What is a callback and how is it different from an update panel control?

I just realized that I have been using controls that implement ICallbackEventHandler (callbacks) without understanding what they actually do and how they are different from an update panel. Can someone please help me to understand?

Thanks!

Upvotes: 1

Views: 1197

Answers (2)

Phillip Benages
Phillip Benages

Reputation: 671

Reasonable explanation found here.

http://www.componentart.com/community/blogs/milos/archive/2007/01/25/callback-vs-updatepanel.aspx

"UpdatePanels post the whole page, effectively performing a postback with each request. They do so asynchronously, so the original page stays put. The control then figures out which updateable areas of the page are affected by that postback (areas in UpdatePanels, essentially), and it redraws those areas, and updates ViewState. This mechanism preserves the old postback-based ASP.NET paradigm.

CallBack uses a different paradigm, simply letting you render some markup into a container, without posting the state of other controls (unless you want to). The rendering is not done via the usual ASP.NET mechanism, but through a server-side event handler, which determines exactly what gets sent back. Nothing else on the page can get modified, and ViewState is left untouched."

Upvotes: 5

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114377

They're two different things.

A callback is an event triggered after the panel is updated. Often this is used to call some JavaScript on the client to open a panel or run some sort of UI effect on the item that was just updated or to set some form of client application state.

Upvotes: 2

Related Questions