10.02.2014 Views

Beginning Ajax With ASP.NET (2006).pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6<br />

Again, before the chapter gets too technical, have a look at how easy it is to make use of Asynchronous<br />

Client Script Callbacks by using some of the controls that support this technology natively.<br />

TreeView Control<br />

The TreeView control allows hierarchical navigation over any datasource. A very common use of this<br />

control is to act as a navigation control for web sites. This is easily achieved by binding the TreeView<br />

control to a SiteMapDataSource control. However, for the purposes of this example you are interested<br />

in the built-in ability to provide asynchronous callback functionality to your applications. Examine the<br />

following simple <strong>ASP</strong>.<strong>NET</strong> page:<br />

Try It Out<br />

TreeView Control Utilizing Asynchronous Client Script Callback Support<br />

<br />

<br />

<br />

<br />

Treeview Asynchronous Example<br />

<br />

<br />

<br />

<br />

&nbsp;<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

This page contains a TreeView control and an XmlDataSource control. The XmlDataSource control<br />

provides data from an XML file named TestXMLFile.xml. This file has the following contents:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!