asp脚本问题

来源:百度知道 编辑:UC知道 时间:2024/07/07 20:39:19
弹出窗口我选取消的话,虽然进入下个页面,为什么后面的还执行了呢?

<script language="javascript">
var conf;
conf = confirm("你确认要删除文章么?");
if(!conf)
window.open("right.asp?method=2","right");
</script>

<%
'连接数据库开始
dim conn
dbpath=server.mappath("db/#mydataroom.mdb")
set conn=server.createobject("adodb.connection")
conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;data source="&dbpath
%>

<%
title=request.QueryString("title")
weizhi=request.QueryString("weizhi")
select case weizhi
case 1
str="delete * from article_1 where [title]='"&title&"'"
conn.execute(str)
case 2
str="delete * from article_2 where [title]='"&title&"'"
conn.execute(str)
case 3
str="delete * from article_3 where [title]=&

1.用ASP的方法,如楼上所说在
<%
response.end
'连接数据库开始
dim conn

2.JS方法,本页面直接转哪个网页
if(!conf)
window.location ("right.asp?method=2","right");

最好两个方法一起用

你在那个进入下面那个页面上加一句代码
response.end
这样就不会向下执行了.