这段asp代码怎么修改呀?

来源:百度知道 编辑:UC知道 时间:2024/05/04 19:52:00
If AdminName = "" Or AdminPassword = "" Or RndPassword = "" Or (EnableSiteManageCode = True And AdminLoginCode <> SiteManageCode) Then
Call WriteEntry(1, "", "管理员未登录")
Call CloseConn
Response.redirect "login.asp"
End If

这段代码是跳转到一个login.asp怎么修改成直接继续下面的代码呢?

<%
If AdminName = "" Or AdminPassword = "" Or RndPassword = "" Or (EnableSiteManageCode = True And AdminLoginCode <> SiteManageCode) Then
Call WriteEntry(1, "", "管理员未登录")
Call CloseConn
%>
content.asp为代码文件,或者直接放在这里。
<!--#include file="content.asp"-->
<%
End If
%>

Response.redirect "login.asp" 是直接跳转 用这个的话 这句下面的asp代码都不会再执行

如果需要跳转 把Response.redirect "login.asp" 改成以下代码
这样 asp的代码执行完毕后再回执行javascript
Response.write "<script language=""JavaScript"">"
Response.write "<location.href = 'login.asp';"
Response.write "</script>"

如果不需要跳转 删除
Response.redirect "login.asp"

把代码放到页面最后,或把代码做成函数。读完所有代码才调用函数,或按需要调用。

删除不就得了