最新aspx分页实用

格式:DOC 上传日期:2023-04-30 18:30:28
最新aspx分页实用
时间:2023-04-30 18:30:28     小编:zdfb

每个人都曾试图在平淡的学习、工作和生活中写一篇文章。写作是培养人的观察、联想、想象、思维和记忆的重要手段。那么我们该如何写一篇较为完美的范文呢?接下来小编就给大家介绍一下优秀的范文该怎么写,我们一起来看一看吧。

aspx分页篇一

asp即active server pages,是microsoft公司开发的.服务器端脚本环境,可用来创建动态交互式网页并建立强大的web应用程序。下面就由yjbys小编给大家介绍asp分页代码。

用这一句调用:

<%

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)

(" 转到" & "<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

%>

读取数据库代码:

<%

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

"目前还没有任何数据"

else

ze =5 '每页记录条数

icount=count '记录总数

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"><>&nbsp;&nbsp;发布时间:<%=rs("adddate")%></td>

<td>&nbsp;</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分页代码是什么】相关文章:

1.

asp缓存类代码

2.

asp加法验证码代码

3.

asp购物车代码

4.

asp获取当前url代码实例

5.

关于asp模板类代码参考

6.

组合模式的php代码

7.

操作ini文件读写类实例代码

8.

html代码是什么

【本文地址:http://www.xuefen.com.cn/zuowen/2772291.html】

全文阅读已结束,如果需要下载本文请点击

下载此文档