当前位置:51VIP源码软件音乐小游戏下载联盟网络学院网络编程ASP技巧 → asp+oracle分页程序类(XDOWNPAGE2.0)

asp+oracle分页程序类(XDOWNPAGE2.0)

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-5-30 0:27:37 我要发布文章
Prev
 Elseif int_curpage=0 then
  str_tmp=Btn_First&" "&Btn_Prev
 else
  int_prvpage=int_curpage-1
  str_tmp="<a href=""#"" onclick=""javascript:generalSubmit('1')"" alt=""第一页"">" & Btn_First&"</a> <a href=""#"" onclick=""javascript:generalSubmit('"&int_prvpage&"')"" alt=""前一页"">" & Btn_Prev&"</a>"
 End If
 ShowFirstPrv=str_tmp
End Function

'=============================================
'ShowNextLast  下一页、末页
'
'
'=============================================
Private Function ShowNextLast()
 Dim str_tmp,int_Nextpage

 If Int_curpage>=int_totalpage Then
  str_tmp=Btn_Next & " " & Btn_Last
 Else
  Int_NextPage=int_curpage+1
  str_tmp="<a href=""#"" onclick=""javascript:generalSubmit('"&int_nextpage&"')"" alt=""后一页"">" & Btn_Next&"</a> <a href=""#"" onclick=""javascript:generalSubmit('"&int_totalpage&"')"" alt=""最后一页"">" &  Btn_Last&"</a>"
 End If
 ShowNextLast=str_tmp
End Function

'End Function
'=============================================
'ShowNumBtn 修改后的数字导航
'
'=============================================
Function showNumBtn()
 Dim i,str_tmp,end_page,start_page

 start_page=1
 'add by sll 2005.05.20 int_curpage=0
 if int_curpage=0 then
  str_tmp=str_tmp&"0"
else
 if int_curpage>1 then
  start_page=int_curpage
  if (int_curpage<=5) then
   start_page=1
  end if
  if (int_curpage>5) then
   start_page=int_curpage-2
  end if
  end if
   end_page=start_page+5
  if end_page>int_totalpage then
  end_page=int_totalpage
  end if
  For i=start_page to end_page
    strTemp=XD_sURL & CStr(i)
    str_tmp=str_tmp & "[<a href=""#"" onclick=""javascript:generalSubmit('"&i&"')"">"&i&"</a>] "
  Next
end if
 showNumBtn=str_tmp
End Function

'=============================================
'ShowGoto 页面跳转
'页面自动跳转
'add by sll 2005.05.20
'=============================================
Private Function ShowGoto()
'response.write int_totalPage
 dim inti
 if int_totalPage<=0 then

  response.write "<select name='goto' disabled>"
   Response.Write "<option value='0'>0</option>"
  response.write "</select>"
else

 response.write "<select name='goto' >"

  for inti=1 to int_totalPage

   Response.Write "<option value='"&inti&"'"
   if cstr(inti)=cstr(int_curpage) then
    response.write "selected"
   end if
    response.write" >"&inti&"</option>"
 next
response.write "</select>"
end if
End Function


'=============================================
'ShowPageInfo  分页信息
'根据要求自行修改
'
'=============================================
Private Function ShowPageInfo()
 Dim str_tmp
 str_tmp=" [页次:<font color=red>"&int_curpage&"</font>/"&int_totalpage&"页] [共"&int_totalrecord&"条] ["&XD_PageSize&"条/页]"
 ShowPageInfo=str_tmp
End Function
'=============================================
'ShowPageSizeChange  改变页大小
'根据要求自行修改
'
'=============================================
public sub ShowPageSizeChange()
 Dim str_tmp
 str_tmp="页大小:<select name='sssssPageSize' >"
 str_tmp=str_tmp & "<option"
 if XD_PageSize=10 then str_tmp =str_tmp & " selected "
 str_tmp=str_tmp & " value='10'>10</option>"
 str_tmp=str_tmp & "<option"
 if XD_PageSize=20 then str_tmp =str_tmp & " selected "
 str_tmp=str_tmp & " value='20'>20</option>"
 str_tmp=str_tmp & "<option"
 if XD_PageSize=50 then str_tmp =str_tmp & " selected "
 str_tmp=str_tmp & " value='50'>50</option>"
 str_tmp=str_tmp & "<option"
 if XD_PageSize=int_totalRecord then str_tmp =str_tmp & " selected "
 str_tmp=str_tmp & " value='" & int_totalRecord & "'>all</option>"
 str_tmp=str_tmp & "</select>"
 response.Write str_tmp
End sub

'=============================================
'修改后的获取当前Url参数的函数
'Codeing by Redsun
'northsnow注释:不知道用在何处,但是保留
'=============================================
Private Function GetUrl()
 Dim ScriptAddress, M_ItemUrl, M_item
 ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))&"?"  '取得当前地址
 If (Request.QueryString <> "") Then
  M_ItemUrl = ""
  For Each M_item In Request.QueryString
   If InStr("page",M_Item)=0 Then
    M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
   End If
  Next
  ScriptAddress = ScriptAddress & M_ItemUrl   '取得带参数地址
 End If
 GetUrl = ScriptAddress '& "page="
End Function


'=============================================
' 设置 Terminate 事件。
'=============================================
Private Sub Class_Terminate
 'XD_RS.close
 'Set XD_RS=nothing
End Sub


'=============================================
'ShowError  错误提示
'=============================================
Private Sub ShowError()
 If str_Error <> "" Then
  Response.Write("" & SW_Error & "")
  Response.End
 End If
End Sub

End class


% >

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