您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
ASP.NET结合存储过程写的通用搜索分页程序
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:20:34
false;
                     //HLPrevPage.Enabled = false;
                 }
                
             if (intPageNo<intPageCount)
                 {
                     HLNextPage.NavigateUrl = String.Concat("select.aspx?CurrentPage=","",intPageNo+1);
                     HLEndPage.NavigateUrl = String.Concat("select.aspx?CurrentPage=","",intPageCount);
                 }
             else
                 {
                     HLNextPage.NavigateUrl = "";
                     HLEndPage.NavigateUrl = "";
                     //HLNextPage.Enabled=false;
                     //HLEndPage.Enabled=false;
                 }
            
         }

</script>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<head>
    <link href="/style.css" rel="stylesheet" />
<style type="text/css">
.high {  font-family: "宋体"; font-size: 9pt; line-height: 140%}
.mid {  font-size: 9pt; line-height: 12pt}
.small {  font-size: 9pt; line-height: normal}
.TP10_5 {
    font-size: 14px;
    line-height: 140%;
}
</style>
    <style type="text/css">A:link {
    COLOR: #cc6666
}
</style>
</head>
<body>
    <form runat="server">
<span class="high">              第<font color="#CC0000"><asp:Label id="LabelRow" runat="server"/></font>页 | 共有<asp:Label id="LabelPage" runat="server"/>页
              | <asp:Label id="LabelRecord" runat="server"/>条信息 |
              <asp:HyperLink id="HLFistPage" Text="首页" runat="server"/>
              | <asp:HyperLink id="HLPrevPage" Text="上一页" runat="server"/>
              | <asp:HyperLink id="HLNextPage" Text="下一页" runat="server"/>
              | <asp:HyperLink id="HLEndPage" Text="尾页" runat="server"/></span><br>
   
        <asp:Repeater id=Repeater runat="server">

            <HeaderTemplate>

      <table width="583" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td bgcolor="#000000"><table width="100%" border="0" cellpadding="4" cellspacing="1" class="TP10_5">
              <tr bgcolor="#999999">
                <td align="center"> <strong><font color="#FFFFFF">订单号</font></strong></td>
                <td align="center"> <strong><font color="#FFFFFF">服务项目</font></strong></td>
                <td align="center"> <strong><font color="#FFFFFF">预订日期</font></strong></td>
                <td align="center"> <strong><font color="#FFFFFF">操作人员</font></strong></td>
                <td align="center"> <strong><font color="#FFFFFF">分配状态</font></strong></td>
                <td> <div align="center"></div></td>
              </tr>
            </HeaderTemplate>

            <ItemTemplate>

              <tr align="center" bgcolor="#FFFFFF" class="small" onMouseOver='this.style.background="#CCCCCC"' onMouseOut='this.style.background="#FFFFFF"'>
                <td><%# DataBinder.Eval(Container.DataItem, "offerid") %></td>
                <td><%# DataBinder.Eval(Container.DataItem, "type") %></td>
                <td><%# DataBinder.Eval(Container.DataItem, "offertime") %></td>
                <td> </td>
                <td> </td>
                <td><a href="javascript:void(window.open('info.asp?id=<%# DataBinder.Eval(Container.DataItem, "offerid") %>','订单分配','height=600,width=1000'))">订单详情</a></td>
              </tr>

            </ItemTemplate>

            <FooterTemplate>

            </table></td>
        </tr>
      </table>

            </FooterTemplate>

        </asp:Repeater>

    </form>
</body>
</html>

--------------------------------------------------------------------------------


up_GetTopicList.sql

--------------------------------------------------------------------------------

CREATE proc up_GetTopicList
       @a_TableList Varchar(200),
       @a_TableName Varchar(30),
       @a_SelectWhere Varchar(500),
       @a_SelectOrderId Varchar(20),
       @a_SelectOrder Varchar(50),
       @a_intPageNo int,
       @a_intPageSize int,
       @RecordCount int OUTPUT
as
   /*定义局部变量*/
   declare @intBeginID         int
   declare @intEndID           int
   declare @intRootRecordCount int
   declare @intRowCount        int
   declare @TmpSelect          NVarchar(600)
   /*关闭计数*/
   set nocount on
  
   /*求总共根贴数*/

   select @TmpSelect = 'set nocount on;select @SPintRootRecordCount = count(*) from '+@a_TableName+' '+@a_SelectWhere
   execute sp_executesql
             @TmpSelect,
             N'@SPintRootRecordCount int OUTPUT',
             @SPintRootRecordCount=@intRootRecordCount OUTPUT

select @RecordCount = @intRootRecordCount

   if (@intRootRecordCount = 0)    --如果没有贴子,则返回零
       return 0
   &

上一页  [1] [2] [3] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |