<%''++++++++++++++++++++++++++++++++++++++ ++++ +++++
'' استدعاء المثال
'خافت int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
'int_RPP=2' قم بتعيين الرقم المعروض لكل صفحة
'int_showNumberLink_=8 'رقم عرض التنقل بين الأرقام
'showMorePageGo_Type_ = 1 'هل هي قائمة منسدلة أم قفزة في قيمة الإدخال؟ عند الاتصال عدة مرات، يمكن تحديد 1 فقط
'str_nonLinkColor_="#999999" 'لون الرابط غير الساخن
'toF_="<fontface=webdings>9</font>" 'الصفحة الرئيسية
'toP10_=" <fontface=webdings>7</font>" 'العشرة الأوائل
'toP1_=" <fontface=webdings>3</font>" 'السابق
'toN1_=" <fontface=webdings>4</font>" 'التالي
'toN10_=" <fontface=webdings>8</font>" 'العشرة القادمة
'toL_="<fontface=webdings>:</font>" 'الصفحة الأخيرة
'=========================== =============
'يجب أن يكون هذا الرمز بين VClass_Rs.Open وحلقة for
'تعيين VClass_Rs = CreateObject(G_FS_RS)
' VClass_Rs.Open This_Fun_Sql,User_Conn,1,1
' إذا لم يكن VClass_Rs.eof ثم
' VClass_Rs.PageSize=int_RPP
' cPageNo=NoSqlHack(Request.QueryString("Page"))
' إذا كان cPageNo = "" فإن cPageNo = 1
إذا لم يكن رقميًا (cPageNo) فإن cPageNo = 1
'cPageNo = كلنج(cPageNo)
' إذا كان cPageNo<=0 فإن cPageNo=1
' إذا كان cPageNo>VClass_Rs.PageCount ثم cPageNo=VClass_Rs.PageCount
' VClass_Rs.AbsolutePage=cPageNo
' لـ int_Start=1 إلى int_RPP
''++++++++++
'أضف نص حلقة لعرض البيانات
''++++++++++
'VClass_Rs.MoveNext
'إذا كان VClass_Rs.eof أو VClass_Rs.bof ثم قم بالخروج لـ
' التالي
'انتهى إذا
'===========================================================================================
'response.Write "<p>"& fPageCount(VClass_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)
''++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++ ++
'********************************************************************************************************************************************************************************* * *********
'الغرض: الاحتفاظ بمعلمات الصفحة الخاصة بالترحيل
'إرسال تناسق الاستعلام
'الإدخال: moveParam: معلمة الترحيل
'removeList: المعلمات المراد إزالتها
"العودة: عنوان URL للترحيل
'********************************************************************************************************************************************************************************* * *********
وظيفة PageUrl(moveParam,removeList)
اسم strName الخافت
خافت KeepUrl، KeepForm، KeepMove
removeList=removeList&"،&moveParam
نموذج الاحتفاظ = ""
لكل strName في Request.Form
'تحديد الإرسال والقيمة الخالية في معلمات النموذج
إذا لم يكن InstrRev("،&removeList&"،"،"،"،&strName&"،، -1، 1)>0 وRequest.Form(strName)<>"" إذن
KeepForm=KeepForm&"&"&strName&"="&Server.URLencode(Request.Form(strName))
نهاية إذا
removeList=removeList&"،&strName
التالي
كيب أورل = ""
لكل سلسلة في Request.QueryString
إذا لم يكن الأمر كذلك (InstrRev("،&removeList&"،،"،"،&strName&"،، -1، 1)>0) ثم
KeepUrl = KeepUrl & "&" & strName & "=" & Server.URLencode(Request.QueryString(strName))
نهاية إذا
التالي
KeepMove=KeepForm&KeepUrl
إذا (KeepMove <> "") ثم
KeepMove = اليمين(KeepMove، Len(KeepMove) - 1)
KeepMove = Server.HTMLEncode(KeepMove) و"&"
نهاية إذا
'PageUrl = استبدال(Request.ServerVariables("URL")"،/Search.asp"،"/Search.html") & "؟" & KeepMove & moveParam & "="
PageUrl = "؟" & KeepMove & moveParam & "="
وظيفة النهاية
الدالة fPageCount(Page_Rs,showNumberLink_,nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,Page)
Dim This_Func_Get_Html_,toPage_,p_,sp2_,I,tpagecount
Dim NaviLength,StartPage,EndPage
This_Func_Get_Html_ = "" : I = 1
NaviLength=showNumberLink_
إذا كان IsEmpty(showMorePageGo_Type_) ثم showMorePageGo_Type_ = 1
tpagecount=Page_Rs.pagecount
إذا كان tPageCount<1 ثم tPageCount=1
إذا لم يكن Page_Rs.eof أم لا Page_Rs.bof ثم
toPage_ = PageUrl("Page"، "submit,GetType,no-cache,_")
إذا كانت الصفحة = 1، إذن
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""الصفحة الرئيسية"">"&toF_&"</font> " &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&"1 title=""الصفحة الرئيسية"">"&toF_&"</a> " &vbNewLine
نهاية إذا
إذا كانت الصفحة <NaviLength إذن
صفحة البداية=1
آخر
StartPage = Fix(Page / NaviLength) * NaviLength
نهاية إذا
EndPage=StartPage+NaviLength-1
إذا EndPage>tPageCount ثم EndPage=tPageCount
إذا StartPage>1 ثم
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_& الصفحة - NaviLength &" title=""上"&int_showNumberLink_&"Page"">"&toP10_&"</a> " &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""上"&int_showNumberLink_&"page"">"&toP10_&"</font> " &vbNewLine
إنهاء إذا
كانت الصفحة <> 1 والصفحة <>0 ثم
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&(Page-1)&" title=""الصفحة السابقة"">"&toP1_&"</a> " &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""الصفحة السابقة"">"&toP1_&"</font> " &vbNewLine
End If
For I=StartPage to EndPage
إذا كنت = الصفحة ثم
This_Func_Get_Html_=This_Func_Get_Html_& "<b>"&I&"</b>" &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&I&">" &I& "</a>" &vbNewLine
نهاية إذا
إذا قمت <>tPageCount، فإن This_Func_Get_Html_=This_Func_Get_Html_& vbNewLine
التالي
إذا كانت الصفحة <> Page_Rs.PageCount والصفحة <>0 ثم
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_&(Page+1)&" title=""الصفحة التالية"">"&toN1_&"</a> " &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""الصفحة التالية"">"&toN1_&"</font> " &vbNewLine
إنهاء إذا
كان EndPage<tpagecount ثم
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_& Page + NaviLength &" title=""下"&int_showNumberLink_&"Page"">"&toN10_&"</a> " &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& " <font color="&nonLinkColor_&" title=""下"&int_showNumberLink_&"page"">"&toN10_&"</font> " &vbNewLine
End If
if Page_Rs.PageCount<>الصفحة إذن
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&Page_Rs.PageCount&" title=""الصفحة الأخيرة"">"&toL_&"</a>" &vbNewLine
آخر
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""الصفحة الأخيرة"">"&toL_&"</font>" &vbNewLine
End If
If showMorePageGo_Type_ = 1 إذن
خافت Show_Page_i
Show_Page_i = الصفحة + 1
إذا Show_Page_i > tPageCount ثم Show_Page_i = 1
This_Func_Get_Html_=This_Func_Get_Html_& "<input type = ""text"" size = ""4"" maxlength = ""10"" name = ""Func_Input_Page"" onmouseover = ""this.focus();"" onfocus = "" this.value='"&Show_Page_i&"';"" onKeyUp=""value=value.replace(/[^1-9]/g,'')"" onbeforepaste=""clipboardData.setData('text',clipboardData .getData('text').replace(/[^1-9]/g,''))"">" &vbNewLine _
&"<input type = ""button"" value = ""Go"" onmouseover = ""Func_Input_Page.focus();"" onclick = ""javascript:var Js_JumpValue;Js_JumpValue=document.all.Func_Input_Page.value;if (Js_JumpValue=='' || !isNaN(Js_JumpValue)) location='"&topage_&"'+Js_JumpValue; else location='"&topage_&"1';"">" &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& " Jump:<select NAME = Menu1 onChange = ""var Js_JumpValue;Js_JumpValue=this.options[this.selectedIndex].value;if(Js_JumpValue!='') location=Js_JumpValue;"">"
لـ i=1 إلى tPageCount
This_Func_Get_Html_=This_Func_Get_Html_& "<قيمة الخيار ="&topage_&i
إذا كانت Page=i ثم This_Func_Get_Html_=This_Func_Get_Html_& " نمط محدد ='color:#0000FF'"
This_Func_Get_Html_=This_Func_Get_Html_& ">الصفحة "&cstr(i)&"</option>" &vbNewLine
التالي
This_Func_Get_Html_=This_Func_Get_Html_& "</select>" &vbNewLine
ينتهي إذا كان
This_Func_Get_Html_=This_Func_Get_Html_& p_&sp2_&" <b>"&Page_Rs.PageSize&"</b> يسجل لكل صفحة، الآن:<b><span class=""tx" "> "&sp2_&Page&"</span>/"&tPageCount&"</b> من الصفحات، إجمالي <b><span id='recordcount'>"&sp2_&Page_Rs.recordCount&"</span></b> من السجلات.
"
لا يوجد سجل
نهاية إذا
fPageCount = This_Func_Get_Html_
وظيفة النهاية
%>
http://blog.csdn.net/hzf100/archive/2006/12/28/1465471.aspx