推薦:網站製作ASP語言的特點與功能ASP(Active Server Page的縮寫) 意思是活動服務器網頁。 ASP是微軟公司開發,用於代替CGI腳本程序的一種應用. 它可以與數據庫和其它程序進行交互,是一種簡單,方便的編程工具。 ASP的網頁文件的格式為.asp,現常用於各種動態網站中。 ASP是一種服務器端腳本編寫環境,可以用
分享一個asp分頁函數,感覺挺好看的。視圖如圖:
可以根據自己的情況修改,代碼:
<%
'謝亮修分頁程序
'call pagecontrol(記錄總數,頁碼總數,當前頁)
Sub PageControl(iCount,pagecount,page)
response.Write(<style type=text/css>/*謝亮分頁CSS*/div.pager{padding:10px;}div.pager a,div.pager span{padding:2px 5px;margin:2px;font-family:宋體;border:1px #363 solid;}div.pager a {text-decoration:none}div.pager a:hover {color:#000;background-color:#363}div.pager span.current {font-weight:bold;color:#fff;background-color:#363}div.pager span.disabled {border:1px #ccc solid;}</style>) &chr(13)
Dim query, a, x, temp
action = http:// & Request.ServerVariables(HTTP_HOST) & Request.ServerVariables(SCRIPT_NAME)
query = Split(Request.ServerVariables(QUERY_STRING), &)
For Each x In query
a = Split(x, =)
If StrComp(a(0), page, vbTextCompare) <> 0 Then
temp = temp & a(0) & = & a(1) & &
End If
Next
response.Write(<div class=pager>)&chr(13)
Response.Write(<span class=disabled> & page & / & pageCount & 頁</span>)&chr(13)
Response.Write(<span class=disabled>共& iCount & 條記錄</span>)&chr(13)
if pagecount<=6 then
for xl=1 to pagecount
if page=xl then
response.Write(<span class='current'>&xl&</span>)&chr(13)
else
Response.Write(<a href=' & action & ? & temp & Page=&xl&'>&xl&</a> )&chr(13)
end if
next
else
if page=1 then
response.Write(<span class='current'>1</span>)&chr(13)
else
Response.Write(<a href=' & action & ? & temp & Page=1'>1</a> )&chr(13)
end if
if page>4 then Response.Write(<span class=disabled>...</span>)&chr(13)
if page<5 then i1=1 else i1=page-2
if page > (pagecount-4) then i2=pagecount else i2=page+3
for xll=i1 to i2
if xll<>1 and xll <> pagecount then
if xll=page then
response.Write(<span class='current'>&xll&</span>)&chr(13)
else
Response.Write(<a href= & action & ? & temp & Page=&xll&>&xll&</a>)&chr(13)
end if
end if
next
if page< (pagecount-4) then Response.Write(<span class=disabled>...</span>) &chr(13)
if page=pagecount then response.Write(<span class='current'>&pagecount&</span>)&chr(13) else Response.Write(<a href=' & action & ? & temp & Page=&pagecount&'>&pagecount&</a> ) &chr(13)
end if
response.Write(</div>)&chr(13)
End Sub
%>
分享:設置C#子窗體在主窗體中居中顯示問題的開始是由C#傳傳看主群裡的印醒提出來的,下面我來說一下解決方案吧其實表面上看是很簡單的開始吧,現在有兩個窗體Form1主窗體,Form2子窗體而且我相信大部分人都會這樣寫在子窗體的Load事件中這樣寫this.StartPosition = FormStartPosition.CenterParent;