调用函数的一段代码,哪处有问题?

heijunma 2004-09-06 05:33:42
<html>
<head>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub OnClick
session.Abandon()
response.Redirect"index.asp"
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<form name="form1" method="post"action="tuichu.asp">
<input type=submit onclick="vbscript:onclick" value="退出">
</form>
</body>
</html>

我想点击"退出"按钮后,执行
session.abandon()
response.redirect"index.asp"
这两条语句.
代码应该怎么写?
...全文
117 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
qxg1123 2004-09-07
  • 打赏
  • 举报
回复
<html>
<head>
<SCRIPT LANGUAGE="VBScript" runat=server>
<!--
if request.querystring("logout")=1 then
call onclick()
end if
Sub OnClick()
session.Abandon()
response.Redirect"index.asp"
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<form name="form1" method="post"action="tuichu.asp?logout=1">
<input type=submit value="退出">
</form>
</body>
</html>

possible_Y 2004-09-06
  • 打赏
  • 举报
回复
tuichu.asp的开头协写上:
session.abandon()
response.redirect"index.asp"
intergameover 2004-09-06
  • 打赏
  • 举报
回复
lbd8848(lbd) 说得对,在当前页只是完成跳转的功能,然后在index.asp中session.abandon(),
<html>
<head>
</HEAD>
<BODY>
<form name="form1" method="post" action="tuichu.asp">
<input type=button onclick="javascript:window.location='index.asp';" value="退出">
</form>
</body>
</html>
guoweidong 2004-09-06
  • 打赏
  • 举报
回复
to lbd8848(lbd)
你的代码不还是JavaScript里的吗?
guoweidong 2004-09-06
  • 打赏
  • 举报
回复
好像不支持onclick事件.不清楚了.
lbd8848 2004-09-06
  • 打赏
  • 举报
回复
session.Abandon()可以写到index.asp中处理
lbd8848 2004-09-06
  • 打赏
  • 举报
回复
session.Abandon()
response.Redirect"index.asp"
只能在服务器端执行,
<SCRIPT LANGUAGE="VBScript">只能在本地执行

如果要转向可以使用
<html>
<head>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub OnClick1

window.location="index.asp"
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<form name="form1" method="post" action="tuichu.asp">
<input type=button onclick="vbscript:onclick1" value="退出">
</form>
</body>
</html>

28,391

社区成员

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

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