不太会asp
这是我的代码
这是我的代码
<!--#include file="conn.asp"-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#thebody {
height: 500px;
width: 870px;
}
#thebody_1 {
height: 200px;
width: 435px;
float: left;
}
#thebody_2 {
height: 200px;
width: 435px;
float: left;
}
#thebody_3 {
height: 200px;
width: 870px;
}
#thebody_1_0 {
background-color: #339900;
height: 30px;
width: 435px;
}
#thebody_1_1 {
height: 30px;
width: 250px;
background-color: #663399;
float: left;
}
#thebody_1_2 {
background-color: #CC6666;
height: 30px;
width: 150px;
float: right;
}
.thebody {
background-color: #00FFCC;
height: 30px;
width: 435px;
}
-->
</style>
</head>
<body>
<div id="thebody">
<div id="thebody_1">
<div id="thebody_1_0"><img src="images/Main_news_top.gif" width="160" height="17" /></div>
<%
set rs2news=server.createobject("adodb.recordset")
sql="select * from News order by adddate desc"
rs2news.open sql,conn,1,1
do while not rs.eof
if rs2news.recordcount=0 then
%>
<div class="thebody">暂无信息</div>
<%else%>
<%
rs2news.PageSize =10
iCount=rs2news.RecordCount
iPageSize=rs2news.PageSize
maxpage=rs2news.PageCount
page=request("page")
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
rs2news.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
%>
<div class="thebody">
<div id="thebody_1_1">
<%=left(trim(rs2news("newsname")),15)%></div>
<div id="thebody_1_2"> <%
response.write (year(rs2news("adddate")))
response.write "-"
addmonth="0"&month(rs2news("adddate"))
response.write right(addmonth,2)
%>-<%addday="0"&day(rs2news("adddate"))
response.write right(addday,2)
%></div>
</div>
<%rs.movenext
loop%>
<%end if%>
</div>
<div id="thebody_2">此处显示 id "thebody_2" 的内容</div>
<div id="thebody_3">此处显示 id "thebody_3" 的内容</div>
</div>
</body>
</html>