日期:2014-05-18  浏览次数:20465 次

上一篇 下一篇 的问题
<%@ Page Title="" Language="C#" MasterPageFile="~/History.Master" AutoEventWireup="true" CodeBehind="txtListBContHistory.aspx.cs" Inherits="WebAppGX.txtListBContHistory" %>
<asp:Content ID="txtListBContHistoryHead" ContentPlaceHolderID="masterHead" runat="server">
</asp:Content>
<asp:Content ID="txtListBContHistoryBody" ContentPlaceHolderID="masterBody" runat="server">
<div class="historyCon" id="cont" runat="server"></div>
 <ul class="sxp">
  <li><a href="#">上一篇:汉字字体知识产权如何保护</a></li>
  <li><a href="#">下一篇:“中国语境”下,汉字字体文化传承的喜与忧</a></li>
  </ul>
</asp:Content>

DAL 层
  #region 上一篇
  public static IList<TxtListB> TxtListBSelectTopUid(int uid, int pid)
  {
  DbHelper db = new DbHelper();
  DbCommand cmd = db.GetSqlStringCommond("SELECT TOP 1 * FROM txtListB WHERE (uid=" + uid + "and id<" + pid + ") ORDER BY id DESC");
  return CollectionHelper.ConvertTo<TxtListB>(db.ExecuteDataTable(cmd));
  }
  #endregion

  #region 下一篇
  public static IList<TxtListB> TxtListBSelectToopUid(int uid, int pid)
  {
  DbHelper db = new DbHelper();
  DbCommand cmd = db.GetSqlStringCommond("SELECT TOP 1 * FROM txtListB WHERE (uid=" + uid + " and id>" + pid + ") ORDER BY id DESC");
  return CollectionHelper.ConvertTo<TxtListB>(db.ExecuteDataTable(cmd));
  }
  #endregion

BLL 层
 #region 上一篇
  public static IList<TxtListB> TxtListBTop(int uid, int pid)
  {
  return TxtListB_DAL.TxtListBSelectTopUid(uid, pid);
  }
  #endregion

  #region 下一篇
  public static IList<TxtListB> TxtListBToop(int uid, int pid)
  {
  return TxtListB_DAL.TxtListBSelectToopUid(uid, pid);
  }
  #endregion

------解决方案--------------------
http://blog.sina.com.cn/s/blog_677623870100lmgj.html
http://hi.baidu.com/raneer/blog/item/7de4624fb9f57cc3d0c86a80.html

参考