每個人都曾試圖在平淡的學習、工作和生活中寫一篇文章。寫作是培養(yǎng)人的觀察、聯(lián)想、想象、思維和記憶的重要手段。那么我們該如何寫一篇較為完美的范文呢?接下來小編就給大家介紹一下優(yōu)秀的范文該怎么寫,我們一起來看一看吧。
aspx分頁篇一
asp即active server pages,是microsoft公司開發(fā)的.服務器端腳本環(huán)境,可用來創(chuàng)建動態(tài)交互式網(wǎng)頁并建立強大的web應用程序。下面就由yjbys小編給大家介紹asp分頁代碼。
用這一句調(diào)用:
<%
call pagecontrol(icount,maxpage,page,"border=0 align=right","<p align=center>",per_page)
%>
<%
sub pagecontrol(icount,pagecount,page,table_style,font_style,per_page)
'生成上一頁下一頁鏈接
dim query, a, x, temp
action = "http://" & variables("http_host") & variables("script_name")
temp=""
("<table " & table_style & ">" & vbcrlf )
("<form method=get on = '" & action & "?zid="& zid & gro_page & "&" & temp & "page='+ ;return false;""><tr>" & vbcrlf )
("<td align=right>" & vbcrlf )
(font_style & vbcrlf )
if page<=1 then
("首頁 " & vbcrlf)
("上頁 " & vbcrlf)
else
("<a href=" & action & "?zid="& zid & gro_page & "&" & temp & "page=1>首頁</a> " & vbcrlf)
("<a href=" & action & "?zid="& zid & gro_page & "&" & temp & "page=" & (page-1) & ">上頁</a> " & vbcrlf)
end if
if page>=pagecount then
("下頁 " & vbcrlf)
("尾頁 " & vbcrlf)
else
("<a href=" & action & "?zid="& zid & gro_page & "&" & temp & "page=" & (page+1) & ">下頁</a> " & vbcrlf)
("<a href=" & action & "?zid="& zid & gro_page & "&" & temp & "page=" & pagecount & ">尾頁</a> " & vbcrlf)
end if
(" 頁次:" & page & "/" & pagecount & "頁" & ?vbcrlf)
(" 共有" & icount & "條/每頁"&per_page&"條" & ?vbcrlf)
(" 轉(zhuǎn)到" & "<input tyep=text size=4 maxlength=8 value=" & page & ">" & "頁" ?& vbcrlf & "<input type=submit style=""font-size: 9pt"" value=go )
("</td>" & vbcrlf )
("</tr></form>" & vbcrlf )
("</table>" & vbcrlf )
end sub
%>
讀取數(shù)據(jù)庫代碼:
<%
if tab_recall_tga="1" then
o_zid=zid
zid=tab_recall_cd(0)
subt_where=" where newtype='"&tab_recall_cd(1)&"'"
end if
i=0
exec="select newsname,adddate,newsid,imgurl,summary from mlist_"&zid&subt_where&" order by adddate desc"
set rs=object("set")
exec,conn,1,1
if and then
"目前還沒有任何數(shù)據(jù)"
else
ze =5 '每頁記錄條數(shù)
icount=count '記錄總數(shù)
ipagesize=ze
maxpage=unt
page=request("page")
per_page=ze
if not isnumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif ?page>maxpage then
page=maxpage
end if
tepage=page
if page=maxpage then
x=icount-(maxpage-1)*ipagesize
else
x=ipagesize
end if
for i=1 to x
if rs("newtype")=0 then
show_type=""
else
show_type=""
end if
uimg="0"
imgurl=trim(rs("imgurl"))
if len(imgurl)>0 then uimg="1"
if uimg<>"1" then ?imgurl="img/"
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="140" valign="top">
<table width="162" height="90" border="0" cellpadding="0" cellspacing="1" bgcolor="c5c5c5">
<tr>
<td width="169" align="center" bgcolor="#ffffff"><img src="<%=imgurl%>" alt="<%=rs("newsname")%>" width="174" height="91" border="0"></td>
</tr>
</table></td>
<td height="70" valign="top">
<table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="88%" height="25"><> 發(fā)布時間:<%=rs("adddate")%></td>
<td> </td>
</tr>
<tr>
<td height="65" valign="top"><%=rs("summary")%></td>
<td ?width="12%" align="right" valign="bottom"><a >
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top"><hr size="1" noshade></td>
</tr>
</table>
<% ? ?xt
next
end if
set rs=nothing
if tab_recall_tga="1" then zid=o_zid '重新恢復虛擬定向表
%>
插入代碼:
exec="insert into admin(user_id,user_pwd,lev)values('"&o_user_id&"','"&o_user_pwd&"','"&o_lev&"')"
' ?exec
e exec
set conn=nothing
更新代碼:
set rs=nothing
set conn=nothing
s("content_relate");【asp分頁代碼是什么】相關(guān)文章:
1.
asp緩存類代碼
2.asp加法驗證碼代碼
3.asp購物車代碼
4.asp獲取當前url代碼實例
5.關(guān)于asp模板類代碼參考
6.組合模式的php代碼
7.操作ini文件讀寫類實例代碼
8.html代碼是什么
【本文地址:http://www.aiweibaby.com/zuowen/2772291.html】