Working with XML Data Using LINQ, a TreeView, and a ListView :: Editing Data
Posted by: 4GuysFromRolla.com Headlines,
on 30 Apr 2008 |
View original | Bookmarked: 0 time(s)
ASP.NET includes a variety of tools for displaying and editing XML documents. A previous article, Working
with XML Data Using LINQ, a TreeView, and a ListView :: Displaying Data, showed how with a TreeView control, a ListView control, an XmlDataSource control,
a LinqDataSource control, and about 50 lines of code we could create a web page that displayed the contents of a hierarchical XML file. Specifically,
the page displayed the contents from a fictional employee phonebook, which allowed for an arbitrary number of employees nested within branches and
departments. The TreeView and XmlDataSource controls displayed the various branches and departments, while the ListView and LinqDataSource controls
displayed the employees belonging to the selected branch or department (or one of its subdepartments).
In addition to displaying data, the ListView and LinqDataSource controls can be augmented to edit, insert, and delete data. This article examines how
to update the ListView and code to enable the visitor to add, edit, and delete employee phone records. By the conclusion of this article we will have
constructed a web page that displays XML data and enables an end user to modify the data from a simple, easy-to-use web page interface. Read on to
learn more!
Read More >