ASP怎样用文章标题作为页面标题
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transiti...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
sql="select title from news where ID='&ID "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=title%>
</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #333333;
}
.STYLE1 {font-size: 14px};
.STYLE2 {
font-size: 12px;
font-weight: bold;}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="970" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="top.asp"--></td>
</tr>
</table>
<%
catalogID=Trim(Request("catalogID")) '栏目ID
dim FirstEditTime
FirstEditTime=now
if catalogid="" then catalogid=19
vid = request("vid")
if(vid="" or not isnumeric(vid)) then vid = "0"
set rs= ShowOneNews("id="&vid)
if not rs.eof then
%>
<table width="970" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="978" height="578"><table width="908" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="212" height="578" valign="top" align="left" background="image/jzbg.jpg"><!--#include file="left.asp"--></td>
<td width="696" align="left" valign="top" bgcolor="#FFFFFF">
<table width="100%" height="156" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left" scope="row" class="wz">>>>
<a href="newsXinWen.asp?catalogid=<%=rs("catalogid")%>" class="wz">
<%=replace(getonecatalogname(catalogid)," ","")%></a>
> <%=rs("title")%></td>
</tr>
<tr>
<td colspan="2" scope="row"><hr size="1" noshade="noshade" class="wz" /></td>
</tr>
<tr>
<td width="72%" align="left" valign="top" scope="row"><table width="78%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="bt" scope="row"><%=rs("title")%></td>
</tr>
<tr>
<td scope="row"><hr size="1" noshade="noshade" class="wz" width="500" /></td>
</tr>
<tr>
<td align="center" valign="top" class="wz" scope="row"><%=formatdatetime(rs("FirstEditTime"),1)%><%=formatdatetime(rs("FirstEditTime"),4)%> 来源:<%=rs("info_1")%> 编辑:<%=rs("info_2")%> </td>
</tr>
<tr>
<td scope="row"><hr size="1" noshade="noshade" class="wz" width="500" /></td>
</tr>
主要是想实现 <title></title>之间可以根据新闻标题自动更换,但是一直会报错,ADODB.Recordset '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
\newsWebXinWen.asp, line 6 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
sql="select title from news where ID='&ID "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=title%>
</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #333333;
}
.STYLE1 {font-size: 14px};
.STYLE2 {
font-size: 12px;
font-weight: bold;}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="970" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="top.asp"--></td>
</tr>
</table>
<%
catalogID=Trim(Request("catalogID")) '栏目ID
dim FirstEditTime
FirstEditTime=now
if catalogid="" then catalogid=19
vid = request("vid")
if(vid="" or not isnumeric(vid)) then vid = "0"
set rs= ShowOneNews("id="&vid)
if not rs.eof then
%>
<table width="970" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="978" height="578"><table width="908" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="212" height="578" valign="top" align="left" background="image/jzbg.jpg"><!--#include file="left.asp"--></td>
<td width="696" align="left" valign="top" bgcolor="#FFFFFF">
<table width="100%" height="156" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left" scope="row" class="wz">>>>
<a href="newsXinWen.asp?catalogid=<%=rs("catalogid")%>" class="wz">
<%=replace(getonecatalogname(catalogid)," ","")%></a>
> <%=rs("title")%></td>
</tr>
<tr>
<td colspan="2" scope="row"><hr size="1" noshade="noshade" class="wz" /></td>
</tr>
<tr>
<td width="72%" align="left" valign="top" scope="row"><table width="78%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="bt" scope="row"><%=rs("title")%></td>
</tr>
<tr>
<td scope="row"><hr size="1" noshade="noshade" class="wz" width="500" /></td>
</tr>
<tr>
<td align="center" valign="top" class="wz" scope="row"><%=formatdatetime(rs("FirstEditTime"),1)%><%=formatdatetime(rs("FirstEditTime"),4)%> 来源:<%=rs("info_1")%> 编辑:<%=rs("info_2")%> </td>
</tr>
<tr>
<td scope="row"><hr size="1" noshade="noshade" class="wz" width="500" /></td>
</tr>
主要是想实现 <title></title>之间可以根据新闻标题自动更换,但是一直会报错,ADODB.Recordset '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
\newsWebXinWen.asp, line 6 展开
2个回答
展开全部
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">
<%
'对 页面上也没看你引入conn文件 也没定义conn
sql="select title from news where ID='&ID "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.recordcount=1 then
title=rs("title")
content=rs("content")
end if
set rs=nothing '每次记录集都要清空
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=title%>
</title>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
'对 页面上也没看你引入conn文件 也没定义conn
sql="select title from news where ID='&ID "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.recordcount=1 then
title=rs("title")
content=rs("content")
end if
set rs=nothing '每次记录集都要清空
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=title%>
</title>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询