在asp中,response.redirect "xx.htm",我想xx.htm在新的窗口打开,怎么办?

Lion_sj 2002-01-10 09:31:05
...全文
191 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
Soft21 2002-01-12
  • 打赏
  • 举报
回复
Up!
ssm1226 2002-01-10
  • 打赏
  • 举报
回复
没问题,我试了
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
用window.close()
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
知道了,原来是window.opn的第二个参数不能一样,谢了
另外问一下,打开failure.htm或yhgl.asp后,我想将原来的小窗体关掉,如何做
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
我改了,还是没有用,窗体的大小没有变
<%
user = Request("username")
'Response.Write user
pass = request("password")
Set conn=Server.CreateObject("ADODB.Connection")
strConn = Application("conn_ConnectionString")
conn.open strConn
'set rs= Server.CreateObject("ADODB.RecordSet")
strSql = "select * from YH WHERE UserName='" & user & "' and PassWard='"&pass& "' and YHQX='管理员'"
Response.Write (strSql)
set rsUser = conn.Execute(strSql)

if rsUser.eof then
%>
<script>
window.open ("failure.htm", "newwindow", "height=500, width=700, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, status=yes")
</script>
<%
'Response.Write "登陆失败,请重新登陆或退出。"
'Response.Redirect "failure.htm"
else
%>
<script>
window.open ("../yhdl/yhgl.asp", "newwindow", "height=500, width=700, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, status=yes")
</script>
<%
'Response.Redirect "../yhdl/yhgl.asp"
end if
rsUser.close
conn.Close ()

%>
ssm1226 2002-01-10
  • 打赏
  • 举报
回复
条件不满足时,中间的代码是不会被执行的
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
在index.htm中我打开一个窗口
window.open ("qxgldl.htm", "newwindow", "height=270, width=230, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
qxgldl.htm是管理登陆页面,提交调用check.asp。
check.asp代码如下:
<%
user = Request("username")
pass = request("password")
Set conn=Server.CreateObject("ADODB.Connection")
strConn = Application("conn_ConnectionString")
conn.open strConn
strSql = "select * from YH WHERE UserName='" & user & "' and PassWard='"&pass& "' and YHQX='管理员'"
set rsUser = conn.Execute(strSql)

if rsUser.eof then
'Response.Redirect "failure.htm"
else
Response.Redirect "../yhdl/yhgl.asp"
end if
rsUser.close
conn.Close ()

%>
此时得到的结果是failure.htm,yhgl.asp显示在很小的页面里

怎么办?麻烦了


Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
这样不是xx.htm和yy.htm都打开吗?
下面是我的源码:
<%
user = Request("username")
'Response.Write user
pass = request("password")
Set conn=Server.CreateObject("ADODB.Connection")
strConn = Application("conn_ConnectionString")
conn.open strConn
'set rs= Server.CreateObject("ADODB.RecordSet")
strSql = "select * from YH WHERE UserName='" & user & "' and PassWard='"&pass& "' and YHQX='管理员'"
Response.Write (strSql)
set rsUser = conn.Execute(strSql)

if rsUser.eof then
Response.Redirect "failure.htm"
else
Response.Redirect "../yhdl/yhgl.asp"
end if
rsUser.close
conn.Close ()

%>

failure.htm,../yhdl/yhgl.asp需另外打开
ssm1226 2002-01-10
  • 打赏
  • 举报
回复
这样行
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
如果有ELSE呢
<%if .......... then%>
<script>window.open("xx.htm")</script>
<%
else
%>
<script>window.open("yy.htm")</script>
<%end if%>

这样不对是吧,怎么办?
希偌 2002-01-10
  • 打赏
  • 举报
回复
可以这样
response.write "<script >window.open('xx.htm')<script>"
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
i try it
ssm1226 2002-01-10
  • 打赏
  • 举报
回复
那好说
比如:
---------------------------
<%if .......... then%>
<script>window.open("xx.htm")</script>
<%end if%>
---------------------------
Lion_sj 2002-01-10
  • 打赏
  • 举报
回复
可是我在ASP中怎么用<script >window.open("xx.htm")<script> 来实现呢?
mars_bolt 2002-01-10
  • 打赏
  • 举报
回复
在xxx.htm的bodyonload 中加上window.Open("")试试吧。没验证过
ssm1226 2002-01-10
  • 打赏
  • 举报
回复
没办法.
可以用<script >window.open("xx.htm")<script>

28,406

社区成员

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

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