A number of personal websites and blogs have a "What I'm Reading" section, where the site owner lists books he's currently reading. Typically these widgets include a cover image
of the book, the title and author, and a link the web visitor can click to buy the book or learn more about it. I recently needed to create a similar sort of widget for a
website I was working on. This website did not require anything overly fancy, it just needed a simple administrative interface where the website administrator could enter
book information and a User Control that he could drop on a web page that would display his current reading queue.
The solution I created uses an XML file to store information about the books displayed in the "What I'm Reading" User Control. The User Control uses a ListView and an XmlDataSource
to display the books in the XML file in a series of
<div> elements. And the administration page use a ListView control and the LINQ to XML library to
provide a web-based interface for adding, updating, and deleting data from this XML file.
This article looks at how I built the User Control and administration interface. The complete source code (in C#) and a demo application is available for download.
Read on to learn more!
Read More >