asp的response.write问题

来源:百度知道 编辑:UC知道 时间:2024/05/12 19:03:00
<!--#include file="vbconn.asp"-->
<html>
<head>
<title>创建相册/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
margin-left: 200px;
margin-right: 200px;
margin-top: 100px;
}
.STYLE1 {font-size: 12px}
-->
</style>
</head>
<body>
<%
if session("username")="" or isempty(session("username")) then
connect.close
set connect=nothing
response.Write("<script>alert('请先登陆');history.back();</script>")
response.End()
else……

这段代码连后面的代码没有错误,用浏览器打开时,
if session("username")="" or isempty(session("username"))成立的时候,源代码是
<html>
<head>
<title>创建相册/title>
<meta http-equiv="Con

呵呵,history.back()中少了-1
<script>alert('请先登陆');history.back(-1);</script>

asp.net 里面的response.Write("<script>alert('请先登陆');</script>")

你可以换一种方式试一下:
<%
if session("username")="" or isempty(session("username")) then
connect.close
set connect=nothing
%>
<script>alert('请先登陆');history.back();</script>
<%
response.End()
else……
%>
这样看行不行?

你显示后的html代码没有问题,可以正常弹出alert啊

浏览器左下角是否有错误的js提示?