第一步:在项目文件里创建db文件夹,在db文件夹里创建db.xml文档。db.xml结构只包含:<Group></Group>
第二步:新建添加留言和显示留言的两个画面:MessageAdd.aspx和MessageList.aspx。下面是两个页面的 前台和后台源码。
1.MessageAdd.aspx
<%@ Page language="c#" Codebehind="MessageAdd.aspx.cs" AutoEventWireup="false" Inherits="XMLGuest.MessageAdd" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>MessageAdd</title>
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<style>.Txt1 {
FONT-SIZE: 12px
}
</style>
</HEAD>
<body>
<form id="MessageAdd" method="post" runat="server">
<FONT face="宋体">
<P> </P>
<P align="center">
<TABLE class="Txt1" id="Table1" cellSpacing="1" cellPadding="4" width="749" bgColor="#efefef"
border="0">
<TR>
<TD bgColor="#e8dabd">您的大名</TD>
<TD style="WIDTH: 508px" bgColor="#ffffff"><asp:textbox id="TextBoxUName" runat="server" LeaveSQL="False" LeaveFormat="False" HtmlEncode="False"
Width="519px" MaxLength="10" CssClass="TextAreaClass"></asp:textbox></TD>
<TD bgColor="#ffffff" colSpan="1" rowSpan="1"></TD>
</TR>
<TR>
<TD bgColor="#e8dabd" colSpan="1" rowSpan="1">E-Mail</TD>
<TD style="WIDTH: 505px" bgColor="#ffffff">
<P><asp:textbox id="TextBoxMail" runat="server" LeaveSQL="False" LeaveFormat="False" HtmlEncode="False"
Width="519px" MaxLength="30" CssClass="TextAreaClass"></asp:textbox></P>
</TD>
<TD bgColor="#ffffff" colSpan="1" rowSpan="1"><BR>
</TD>
</TR>
<TR>
<TD bgColor="#e8dabd" colSpan="1" rowSpan="1">内容<