注册 登录
编程论坛 ASP技术论坛

[求助]操作后不能返回到指定页面

lecojason 发布于 2007-09-10 09:38, 538 次点击
咨询个问题.不管我增加删除或修改.后都不能返回到指定的页面.数据库读写一切正常.
如下面代码
sub setnew()
pid=Request.querystring("productid")
dbconn.execute"update product set isnew=1 where productid="&Pid
rs1.close
set rs1=nothing
response.write"<script language='javascript'>alert('delete is success!');window.location.href='productlist.asp';</script>"
response.End()
end sub

response.redirect""也用过.还是不会返回到指定页面
6 回复
#2
hmhz2007-09-10 09:46
操作后有弹出对话框吗?
#3
盖世豪侠2007-09-10 09:57
[QUOTE]response.redirect""也用过.还是不会返回到指定页面[/QUOTE]
你没有接好值,
#4
lecojason2007-09-10 11:34

没有对话框弹出呢.

盖世:你说的没有接好值?是什么呢?
我用的还是response.redirect "productlist.asp"
也是不行.就出现一白色背景.但是数据已经更新了.就是返回不到指定页面.

什么地方出问题呢?

#5
hmhz2007-09-10 11:37
sub setnew()
pid=Request.querystring("productid")
dbconn.execute "update product set isnew=1 where productid="&Pid
response.write "<script language='javascript'>alert('delete is success!');window.location.href='productlist.asp';</script>"
response.End()
end sub
#6
lecojason2007-09-10 12:05
能返回指定页面,谢谢.
为什么要把RS1.CLOSE和set rs1=nothing取消.不解????

不是说要清空吗?
#7
hmhz2007-09-10 13:11
如果使用
rs1.close
set rs1=nothing


就得写成这样的
set rs1=server.createobject("adodb.recordset")
rs1.open "select * form product where productid="&Pid,conn,1,3
rs1("isnew")=1
rs1.update
rs1.close
set rs1=nothing
1