asp简单的ajax留言板(采用三层模式)

2019-09-14 07:30:50于海丽

   const C_FIRSTPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">首页</a>"
   const C_FIRSTPAGE2 = " 首页"
   const C_PREVPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">上一页</a>"
   const C_PREVPAGE2 = " 上一页"
   const C_NEXTPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">下一页</a>"
   const C_NEXTPAGE2 = " 下一页"
   const C_LASTPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">尾页</a>"
   const C_LASTPAGE2 = " 尾页"
   const C_CURRENTPAGE = " 页次:<STRONG><FONT color=""red"">{0}</FONT>/{1}</STRONG>页"
   const C_PAGESIZE = " <STRONG>{0}</STRONG>篇/页  "
   const C_GOTOPAGE = " 跳转:<input type=""text"" name=""goto"" value=""{1}"" onchange=""$('{0}&PageNo='+this.value)"" style=""width:20px;border:1px""/>  "

   Dim PageCount,pages
   Dim lRecordCount,lFirstpage,lPrevpage,lNextpage,lLastpage,lCurrentpage,lPagesize,lGotopage
   Dim p,parms

   If RecordCount Mod PageSize <> 0 Then
    pages = 1
   else
    pages = 0
   End If
   PageCount=CInt(RecordCount/PageSize + pages)

   parms=Array(RecordCount)
   lRecordCount = Format(C_RECORDCOUNT,parms)

   if CInt(CurrentPage)>1 Then
    parms=Array(Pageurl,1)
    lFirstpage = Format(C_FIRSTPAGE1,parms)
    parms=Array(Pageurl,CInt(CurrentPage)-1)
    lPrevpage = Format(C_PREVPAGE1,parms)
   Else
    lFirstpage=C_FIRSTPAGE2
    lPrevpage=C_PREVPAGE2
   End If

   if CInt(CurrentPage)<PageCount Then
    parms=Array(Pageurl,CInt(CurrentPage)+1)
    lNextpage = Format(C_NEXTPAGE1,parms)
    parms=Array(Pageurl,CInt(CurrentPage)+1)
    lLastpage = Format(C_LASTPAGE1,parms)
   Else   
    lNextpage=C_NEXTPAGE2
    lLastpage=C_LASTPAGE2
   End If

   parms=Array(CurrentPage,PageCount)
   lCurrentpage = Format(C_CURRENTPAGE,parms)
   parms=Array(PageSize)
   lPagesize = Format(C_PAGESIZE,parms)
   parms=Array(Pageurl,CurrentPage)
   lGotopage = Format(C_GOTOPAGE,parms)

   p=lRecordCount&lFirstpage&lPrevpage&lNextpage&lLastpage&lCurrentpage&lPagesize&lGotopage