asp长文章分页
雪克 2010-07-23 11:58:45 <!-- #include file="INC/in.asp" -->
<!-- #include file="INC/Const.asp" -->
<!-- #include file="INC/Conn.asp" -->
<%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid) + "..."
else
cutstr=tempstr
end if
end function
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新闻</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<%
id=request("id")
set rs=server.CreateObject("ADODB.recordset")
sqlstr="select * from News where unid="&id
rs.open sqlstr,conn,1,1
%>
</head>
<body>
<table width="100%" height="1314" border="0" cellpadding="0" cellspacing="0" class="container">
<tr>
<td height="1314" valign="top"><table width="996" height="1314" border="0" align="center" cellpadding="0" cellspacing="0" class="bg">
<tr>
<td height="1314" valign="top">
<!-- #include file="top.html" -->
<table width="996" height="202" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="996" height="202">
<param name="movie" value="flash/banner1.swf" />
<param name="quality" value="high" />
<embed src="flash/banner1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="996" height="202"></embed>
</object></td>
</tr>
</table>
<table width="986" height="670" border="0" align="center" cellpadding="0" cellspacing="0" class="main">
<tr>
<td width="245" height="670" valign="top">
<!-- #include file="left1.html" -->
</td>
<td valign="top"><table width="739" height="42" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/right_dh_03.gif"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5%"> </td>
<td width="95%" class="right_dh">新闻内容</td>
</tr>
</table></td>
</tr>
</table>
<table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle" class="zt">
<%
page=request("page")'当前页数
if page="" then page=1
detail=rs("Description")
ContentArray = Split(detail,"[Page]")
NewsPageCount = UBound(ContentArray) + 1
<%=ContentArray(page-1)
%>
<!--显示分页-->
<%
if NewsPageCount > 1 then
%>
<div align="center">本新闻共<font color=red><%=NewsPageCount%></font>页,当前在第<font color=red><%=page%></font>页</div>
<%for j = 1 to NewsPageCount
if page = j then
NewsPageStr = NewsPageStr & "<font color=""red"">" & j & "</font> "
else
NewsPageStr = NewsPageStr & "<a href=""flfg_info.asp?id=" & id & "&page="&j&""">" & j & "</a> "
end if
Next
response.Write(NewsPageStr)
%>
<%=rs("Description")%></td>
</tr>
<tr>
<td height="10"></td>
</tr>
</table></td>
</tr>
</table>
<!-- #include file="foot.html" --></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
想做个长文章分页但就是不出来,请高手帮看看