Source Code Location
Live demo for this sample is available at our website:
http://www.essentialobjects.com/demo/default.aspx?id=callback_cars.
Source code for demo project can be launched from:
Start -> Programs -> EO.Web Controls x.x -> EO.Web for ASP.NET x.x
-> Live Demo
If your installation directory is "c:\Program Files\Essential Objects", then
this demo is located at: "c:\Program Files\Essential Objects\EO.Web Controls
3.0\Net11\Samples\CS\Demos\Callback\Features\Partial Page Updates - Cars".
Demos for .NET 2.0 and VB are also available.
Description
By using CallbackPanel, you can
update a portion of the Web page without refreshing the whole page. This topic
shows how to use EO.Web implement a simple to render updated content from the
server.
This demo has a backend database containing the "Car" information. When end user
selects a car, a callback request is sent to the server to retrieve the current
selected car information from database, and update only the "Car info area" of
the page. The page will look like:
To render content through CallbackPanel:
-
Drag an EO.Web CallbackPanel
onto the Web Form.
-
Drag and drop several ASP.NET label controls in the CallbackPanel to construct
the car info page.
-
Right click the CallbackPanel control and click "Edit Triggers".
-
In CallbackPanel Triggers Collection Editor, add three radio buttons as three
triggers and specify parameter for each trigger.
-
Double click the CallbackPanel control to hook up the "Execute" event in the
code behind.
-
In the code behind, design and implement the routine to handle the
CallbackPanel's Execute event. In the following code, it retrieves the Car
information from backend database and directly updates the Label control's Text
property. Refer to sample location for the code.
-
We're done! Build and browse the page.