Unveil the Data Binding Architecture inside Microsoft ASP.NET Ajax 1.0 - Part 2
page 2 of 7
by Xianzhong Zhu
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 32635/ 70

Look back to the sample in part 1

To familiarize you with plenty of controls and concepts concerning data binding on the client side, we have constructed a simple and integrated sample - AJAXCTPDev311. Let us summarize the important features with it.

·         It provides an integrated framework to create the basic MS AJAX data binding applications.

·         To create the website we have chosen to use the "ASP.NET AJAX CTP-Enabled Web Site" template; however, you can also use the common "ASP.NET AJAX-Enabled Web Site" template, but you have to add the assembly Microsoft.Web.Preview.dll (supporting xml-script programming and data binding) manually.

·         Whatever kinds of MS AJAX applications you are to create, the ScriptManager control plays the core role of whole AJAX architecturefrom the client side to the server side. In general, we should explicitly specify the web service related *.asmx files and the assemblies we use. Here we again list this related piece of code.

Listing 1

<asp:ScriptManager ID="ScriptManager1" runat="server" >
  <Services>
    <asp:ServiceReference Path="BookDataService.asmx" />
  </Services>
  <Scripts>
  <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" />
  </Scripts>
</asp:ScriptManager>

·         The ListView (and ItemViewto be used in the third sample) control has several templates, which are in turn associated with a set of div elements which may contain most of the basic HTML elements such as button, textbox, span, hyperlink, etc. Altogether to use ListView and ItemView, you have to earnestly analyze and grip the relationships between the templates and the div elements.

·         The declarative mode is a new and good approach of programming on the client side, which is to be studies in the next section.

·         The following diagram reveals the relations among the several key components we used.

Figure 1: The different data form transferred between the key components

Note here: First, the data form transferred among ListView, DataSource and WebService are different; second, the WebService generally provides data from databasesthe rectangle with broken lines here only means we have not used this form (to be examined in the third sample later on).

·         We have used a special kind of WebServiceDataService to provide data to ListView from the server side.

·         We have used the methods of WebService directly from the client side, have not we? This is a great change MS AJAX has brought to us.

Now, let us look more closely at the declarative mode with xml-script.


View Entire Article

User Comments

Title: binding the listview   
Name: silo
Date: 2010-08-02 8:14:52 AM
Comment:
the sample code has a crc error when i try to extract it.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-23 9:54:59 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search