温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:51aspx修正版简单三层留言板源码
当前文件:
LeaveMessageMVC/index.aspx,打开代码结构图
LeaveMessageMVC/index.aspx,打开代码结构图1<%@ Page Language="C#" AutoEventWireup="true" Inherits="LeaveMessagePage" Codebehind="index.aspx.cs" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head runat="server"> 7
<title>留言板测试页面</title> 8
<link type="text/css" rel="Stylesheet" href="css/LM.css" /> 9
<script type="text/javascript" src="JS/AutoScroll.js"></script> 10
</head> 11
<body style="background-color:White"> 12
<form id="form1" runat="server"> 13
<div> 14
<%--<input id="Button1" type="button"onClick="ScrollDown()" value="滚动到最下"/> 15
<a href="#IwantToSay">我要留言</a><!--利用锚点链接可以直接转到发言区,比滚屏到最底更实用--><br />--%> 16
<div id="LMHead" class="LMindexHead" style="font-family:黑体; width:700px;"> 三层留言板51aspx修正版</div> 17
<br /> 18
<asp:DataList ID="LeaveMessageList" runat="server" OnItemCommand="LeaveMessageList_ItemCommand" Width="700px"> 19
<ItemTemplate> 20
<table border="1" cellpadding="0" cellspacing="0" width="100%" style="border-right: #6699cc 1px solid; border-top: #6699cc 1px solid; border-left: #6699cc 1px solid; border-bottom: #6699cc 1px solid;"> 21
<tr> 22
<th style="text-align:left; font-weight: bold; border-bottom: #6699ff thin solid; border-right:0px; width:70%"> 23
<span><%--调用JavaScript实现记录楼数--%> 24
<script type="text/javascript" src="JS/ShowFloorAtLMBox.js"></script> 25
</span> 26
主题:<%# DataBinder.Eval(Container.DataItem,"Title") %></th> 27
<td align="right" style="border-bottom: #6699ff thin solid; border-left:0px; width:30%"><asp:LinkButton ID="LinkButton1" runat="server" CommandName=<%# DataBinder.Eval(Container.DataItem,"ID") %> Text="回复"/> | <a href="#IwantToSay">滚动到最下</a> | <a href="#" onclick="toTop();">Top</a> </td> 28
</tr> 29
<tr> 30
<td style="font-size:smaller" colspan="2"> 31
作者:<%# DataBinder.Eval(Container.DataItem,"User") %> 32
33
QQ/MSN:<%# DataBinder.Eval(Container.DataItem,"QQMSN") %> 34
35
<font color="gray"><%# DataBinder.Eval(Container.DataItem,"SubmitTime") %></font> 36
</td> 37
</tr> 38
<tr> 39
<td colspan="2"> 40
<div style="margin-left:4px; margin-right:4px; margin-top:2px; margin-bottom:2px; color:Black; font-size:18px"> 41
<asp:Label ID="LContents" runat="server" Width="100%" 42
Text=<%# ShortString(Convert.ToString(DataBinder.Eval(Container.DataItem,"Contents")), Convert.ToString(DataBinder.Eval(Container.DataItem,"ID"))) %> 43
style="word-break:break-all" /> 44
<br /> 45
<hr width="90%" align="left" /> 46
<div style=" margin-left:2px; margin-right:2px; color:#666666; font-size:14px"> 47
<asp:Label ID="LWriteBack" runat="server" Width="100%" Text=<%# DataBinder.Eval(Container.DataItem,"WriteBack") %> style="word-break:break-all" /> 48
</div> 49
</div> 50
</td> 51
</tr> 52
</table> 53
</ItemTemplate> 54
</asp:DataList> 55
<a href="LMListForPublic.aspx"><img border="0" src="image/viewAll.gif" /></a> 56
<br /> 57
<%--<input id="Button2" type="button"onClick="toTop()" value="Top"/>--%> 58
<br /> 59
<table id="lmt" border="1" style="width: 700px; height: 180px"> 60
<tr> 61
<td style="width: 100%; height:25px"> 62
用户名:<asp:TextBox ID="TBuser" runat="server" Height="21px" Width="150px"></asp:TextBox> <span 63
style="color: #ff0033">*</span> 64
QQ / MSN:<asp:TextBox ID="TBQQMSN" runat="server" Height="21px" Width="150px"></asp:TextBox> 65
<span style="color: #ff0033">*</span></td> 66
</tr> 67
<tr> 68
<td style="width: 100%; height:25px"> 69
留言标题:<asp:TextBox ID="TBtitle" runat="server" Height="21px" Width="412px"></asp:TextBox></td> 70
</tr> 71
<tr> 72
<td style="width: 100%; height:100px"> 73
留言信息:<span style="font-size:small; color:Gray">(按 Ctrl+Enter 提交)</span> 74
<br /> 75
<asp:TextBox ID="TBcontents" runat="server" Height="80px" Width="90%" TextMode="MultiLine"></asp:TextBox> 76
<span style="color: #ff0000">*</span></td> 77
</tr> 78
<tr> 79
<td style="width: 100%; height:30px; text-align: center;"> 80
<asp:Button ID="Submit" CssClass="ButtonCss" runat="server" Width="100px" Text="提交" OnClick="Submit_Click" /></td> 81
</tr> 82
</table> 83
<a name="IwantToSay"/> 84
</div> 85
</form> 86
<a href="http://www.51aspx.com/" target="_blank">download from 51aspx.com</a> 87
88
</body> 89
</html> 90



