简体   繁体   中英

VBScript runtime error '800a01a8', Object required: '' when using WScript.Quit

I am putting the final pieces into a VBScript page and one thing I want to handle is if the variable being passed in via the URL is empty. If that is the case, I want the page to stop running and show a 'must log in' message.

I have the following code in place:

<%
If (Request.QueryString("nn") = "") Then
Response.Write "<p>You must be logged in to view content. <a href='http://URL/login?ReturnUrl=/interests'>Click here</a> to log in.</p>"
    WScript.Quit
End If
%>

The error throws on the line WScript.Quit . Any ideas?

WScript.Quit , as the name implies, is part of the Windows Script Host . You appear to be using VBScript within a different host: ASP. If you need to stop processing an ASP page, just end the server's response by using:

Response.End

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM