playking(风雪青松) 请来答!

流浪爷们 2002-03-21 10:32:36
我怎么把存到数据库中的记录取出来,再用原来的方法进行编辑呢?
如下方法不奏效啊:
<!--#include file="conn.asp"-->
<%
set rst=server.createobject("adodb.recordset")
sql="select * from nclass where id ="&Cint(request("id"))
rst.open sql,conn,1,1
%>

<input type="hidden" name="id" value="<% =rst("id") %>">
<iframe class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="99%"

height="212">
<% =rst("nclass") %>
</iframe>

<%
rst.close
set rst=nothing
conn.close
set conn=nothing
%>

请告知!
谢谢!
email: sunmuking@163.com
...全文
97 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
playking 2002-03-25
  • 打赏
  • 举报
回复
祝贺你了!
该给分了,哈哈!!
流浪爷们 2002-03-25
  • 打赏
  • 举报
回复
呵呵……

我通过其他的方式解决了。谢谢大家了。
playking 2002-03-22
  • 打赏
  • 举报
回复
我刚才用如下方式测试通过:(可以进行编辑)
function aaa()
{
document.add_article.doc_html.value="<hr><font size=7 color=red>aaa</font><table border=1><tr><td>啊啊啊啊</td></tr></table>";
}

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="javascript:aaa();">
playking 2002-03-22
  • 打赏
  • 举报
回复
你的文件中是不是有这样一句(假设这个文件是:html_edit.htm):
<iframe class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="240">
</iframe>
<script src="edit.js" type="text/javascript"></script>

你另外用一个文件把html_edit.htm嵌入进去:

<form name="add_article">
<table border=1 bordercolor=gray >
<tr><td align=center>
<OBJECT id=doc_html style="LEFT: 0px; TOP: 0px" data="html_edit.htm" width=544 height=320 type="text/x-scriptlet" VIEWASTEXT></OBJECT>
</td></tr></table>
<input type="hidden" name="content" value="">
</form>

onload这样写:
document.add_article.doc_html.value="<%=rst("nclass")%>";

实在不行,你再试试:
<input type="hidden" name="content" value="<%=rst("nclass")%>">

onload时:
document.add_article.doc_html.value=document.add_article.content.value
playking 2002-03-22
  • 打赏
  • 举报
回复
1:试试去掉双引号,如果不行,试下面一个
2:body.onload不行,用window.onload
function window.onload()
{
//同样试试第一步
Composition.document.body.innerHTML="<%=rst("nclass")%>"
//或者
//Composition.document.body.innerHTML=<%=rst("nclass")%>
}
流浪爷们 2002-03-22
  • 打赏
  • 举报
回复
第一种方法不奏效啊!根本连显示都不显示,会不会是这句 Composition.document.body.innerHTML="<%=rst("nclass")%>"中的


="<%=rst("nclass")%>" 有问题?
希偌 2002-03-21
  • 打赏
  • 举报
回复
写进数据库是怎么样replace的,就反过来replace呀!
julyclyde 2002-03-21
  • 打赏
  • 举报
回复
src应该是文件名
playking 2002-03-21
  • 打赏
  • 举报
回复
下面这个方法我没用过,突然想到的,你试试,结果要记得告诉我啊!
<iframe class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="99%" height="212" src="<%=rst("nclass")%>">
</iframe>
playking 2002-03-21
  • 打赏
  • 举报
回复
你还可以试试:
<iframe class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="99%" height="212" src="aa.asp">
</iframe>

在aa.asp中:
response.write rst("nclass")

或者在aa.asp中:
<html>
<body>
<pre><%=rst("nclass")%></pre>
</body>
</html>
playking 2002-03-21
  • 打赏
  • 举报
回复
不好意思,刚来。
你试试用onload事件:
<body onload="javascript:comload();">
<script>
function comload()
{
Composition.document.body.innerHTML="<%=rst("nclass")%>"
}
</script>

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧