AJAX-Tools
Apart from being used in complicated RIAs with colorful interfaces, Ajax is also used for a more practical use such as data control and interaction. There are functions that any developer could use to display data in an Ajax way which does not only look good but has efficient functions which could not be seen in HTML based sites.
It is relatively easy to build a repeater control. A repeater control is a binding of XML, JavaScript and HTML codes that could get really messy if you do not do it step by step. As we have previously pointed out, Ajax repeater control is quite easy since you just have to create an XML file and wrap it up with JS and HTML. But XML takes a lot of line that when you integrate the whole webpage with the repeater in it, you will never get to understand the whole webpage yourself.
To build the Ajax repeater control, the first code you have to build the XML file. No need to be fancy there since you can easily create an XML table and you can stretch it as long as you can.
The next step is to attach the XML file to a namespace with the filename “Systems.Data”. This will inform that system that you have an information that could be loaded immediately in the website or in the application.
But at this moment, XML file with the “Systems.Data” namespace will just inform the program with its presence. You still need to build a function so that it will be properly loaded.
The XML file with “Systems.Data” should be wrapped in a function so that it will be able to interact with another function. You need to wrap the whole data file in DataSet. The DataSet will identify which file to load. This is very useful especially when you have multiple XML file in a single application. It could be easily loaded with a simple DataSet.
Once they are set, it is time to build the repeater control. Take note that this is a repeater control which means it will be control that data output. Repeater controls always involves the following functions: ItemTemplate, HeaderTemplate and FooterTemplate. There are other functions that could be used but they are not necessary and they are: AlternatingItemTemplate and SeperatorTemplate.
But the process of building a data with repeater control is not finished. At this stage, you are just done with the coding of specific functions and data that will be loaded in the program. They are just working independently with each other without even touching each function. You need to combine everything so that with just one click, everything will be rendered in the webpage or in a specific page in an application.
You can do this by stringing together the Namespace, DataSet, and Repeater control. This could be done by HTML. That would be easier considering you already have specific data controls that run using JavaScript.
Lastly, take note that the data is being run in the server. When you communicate this data to the client, do not use POST instead use GET. It is a common mistake but it could be easily changed with just one word.