One. summary:
The message board is an important part of the website. It is the place where visitors express opinions are also a powerful tool for website administrators to understand the basic situation of the website. So the message board played an important role in the current website.
However, in the previous development of a message book is not an easy task, the developer's work will teach a lot. And now with Microsoft launches vs.net, the corresponding technology is new. In particular, XML is widely used in .NET Framework, the entire .NET architecture has a very superior foundation. At the same time, it is also accompanied by a emerging language C #. C # As an important part of Microsoft .NET strategy, it has special excellent performance. So the ASP.NET program in this article is described in C # language, while the entire program is based on XML. I used XML as a database of the program, mainly because the server is supported by XML files.
two. Claim:
(1) .NET SDK BETA2 and later
(2) Support for ASP.NET web server
three. Description:
The examples of this article consist of two parts:
(1) GuestPost.aspx - Add user information to an XML file
(2) ViewGuestbook.aspx - create a dataset object first. After the establishment, it is easy to display the data. I used a "repeater" to display data in the data set. Also, the reader can try to modify the viewpage based on your own preference.
four. Code:
(1) GuestPost.aspx:
<% @ Page language = "c #" EnableSessionState = "false"%> <% @ import namespace = "system"%> <% @ Import namespace = "system.io"%> <% @ Import namespace = "system.data "%> <% - these are the namespaces that must be used in this program -%>