62,041
社区成员
发帖
与我相关
我的任务
分享
<style type="text/css">
.feedBack{ width:545px; margin:0 auto;}
.feedBack p,div{ padding:0; margin:0;}
div.lyBox{ border:#D0D0D0 solid 1px; margin:6px 0;}/*框框*/
p.lyContent{}/*用户留言内容*/
p.lyRep{ background-color:#EBEBEB;border:#C0BFBF dotted 1px; width:98%; margin:5px auto;}/*管理员回复内容*/
</style>
<!--修饰部分省略-->
<div class="feedBack">
<!--留言列表 start-->
<!--留言列表 start-->
<asp:Repeater ID="rptFeedBackList" runat="server">
<ItemTemplate>
<div class="lyBox">
<p class="lyContent">
[<strong><%#Eval("AddDate","{0:yyyy-MM-dd}") %></strong>]问:
<%#Eval("Content") %>
</p>
<p class="lyRep">
<%#Eval("Reply") %>
</p>
</div>
</ItemTemplate>
</asp:Repeater>
<!--留言列表 end-->
<!--留言列表 end-->
</div>
<!--分页 start-->
<div class="paging">
<webdiyer:aspnetpager ID="anpObjList"
PageSize="15" runat="server" Visible="true"
ShowPageIndex="true"
FirstPageText="首页"
LastPageText="尾页"
AlwaysShow="True"
NextPageText="下一页"
PrevPageText="前一页"
ShowPageIndexBox="Always"
ShowNavigationToolTip="True"
onpagechanged="anpObjList_PageChanged"
MoreButtonClass=""
NumericButtonCount="15" NumericButtonType="Text"
PageIndexBoxType="DropDownList">
</webdiyer:aspnetpager>
</div>
<!--分页 end-->
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.UcSubNav1.NavTitleSub = "在线留言";
this.UcSubNav1.NavTitleLeft = "在线留言";
DBView();
}
}
/// <summary>
/// 读取审核后的留言以及回复内容
/// </summary>
protected void DBView()
{
string cmdTxt = "";
DataTable newsList = null;
//读取留言信息
cmdTxt = "select ID,Content,Reply,AddDate from FeedBack where IsShow=1 and IsRead=1 order by AddDate desc";
newsList = SqlHelperSql.GetDataSet(cmdTxt).Tables[0];
PagedDataSource pds = new PagedDataSource();
pds.DataSource = newsList.DefaultView;
anpObjList.RecordCount = newsList.Rows.Count;
pds.CurrentPageIndex = anpObjList.CurrentPageIndex - 1;
pds.PageSize = anpObjList.PageSize;
pds.AllowPaging = true;
this.rptFeedBackList.DataSource = pds;
this.rptFeedBackList.DataBind();
}
protected void anpObjList_PageChanged(object sender, EventArgs e)
{
DBView();
}