This tutorial instructs how to create a simple Guestbook using an XML file for storage of comments. C# version.

User interaction on a website is becoming more and more common; allowing users to add comments on a website is one of many features we can implement to increase interactivity on a site. Such interactivity as a guestbook can use either XML or a database as a storage medium for comments. In this tutorial, we will show how we can use an XML file to store guestbook entries, and add new ones to it.

Firstly, we will need the following assembly reference:

We add a small form to allow new entries, and also a DataList to display existing entries

The ASPX page will look something like this:

Our XML document will look something like this, with the first guestbook entry:

Yes, it is possible to find a good web host. Sometimes it takes a while. After trying several, we went with Server Intellect and have been very happy. They are the most professional, customer service friendly and technically knowledgeable host we’ve found so far.

The code-behind will look something like this:

Download Source Files