留言板----浏览留言内容页面(messageout.aspx)
<body>
<form id="form1" runat="server">
<div>
<center>
<table>
<tr>
<td style="color: #ffffff; background-color: #669900" align="left">
<span style="font-size: 16pt">留言内容</span>
</td>
</tr>
<tr>
<td>
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<span style="font-size: smaller">
<table style="width: 513px">
<tr>
<td align="left" style="width: 54px; background-image: none; color: #660000; background-color:White;">
留言人:</td>
<td style="width:92px" align="left">
<asp:Label ID="unameLabel" runat="server" Text='<%# Eval("uname") %>'></asp:Label>
</td>
<td align="left" style="width: 67px; color: #990000; background-color:White;">
留言时间:</td>
<td style="width:92px" align="left">
<asp:Label ID="timesLabel" runat="server" Text='<%# Eval("times") %>'></asp:Label>
</td>
</tr>
<tr>
<td colspan="4" align="left" style="color: #990000; background-color:White">
留言主题:</td>
</tr>
<tr>
<td colspan="4" align="left">
<asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title")%>' Width="489px"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4" align="left" style="color: #990000; background-color: White; height: 8px ; " >
留言内容:</td>
</tr>
<tr>
<td colspan="4" align="left">
<asp:Label ID="contentLabel" runat="server" Text='<%# Eval("content")%>' Width="498px"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4">
<hr style="height: 5px" />
</td>
</tr>
</table>
</span>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:messageConnectionString %>"
SelectCommand="SELECT * FROM [message]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td align="left">
<asp:Button ID="continueButton" runat="server" Text="继续留言" OnClick="continueButton_Click" />
</td>
</tr>
</table>
</center>
</div>
</form>
</body>
后台代码如下:
public partial class messageout : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void continueButton_Click(object sender, EventArgs e)
{
Response.Redirect("message.aspx");
}
}