Recommended: Features and functions of website production ASP language ASP (Abbreviation of Active Server Page) means the active server web page. ASP is an application developed by Microsoft to replace CGI scripting programs. It can interact with databases and other programs and is a simple and convenient programming tool. The format of ASP's web page file is .asp, and it is now commonly used in various dynamic websites. ASP is a server-side scripting environment that can be used
Share an asp pagination function, it looks pretty good. The view is shown in the figure:
You can modify it according to your own situation, code:
<%
'Xie Liang repairs the paging program
'call pagecontrol(total number of records, total number of page numbers, current page)
Sub PageControl(iCount,pagecount,page)
response.Write(<style type=text/css>/*Xie Liang Pagination 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.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 & page</span>)&chr(13)
Response.Write(<span class=disabled>Total&iCount & Record</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
%>
Share: Set the C# subform to be displayed in the center in the main form The beginning of the problem was raised by C# transmission and reading the wake-up in the main group. Let me talk about the solution below. Actually, it seems to be a very simple start on the surface. There are two forms, Form1 main form, Form2 sub-form, and I believe that most people will write this in the Load event of the sub-form. This is how this.StartPosition = FormStartPosition.CenterParent;