With Windows 2000 and above, response buffering is on by default. So, your
response.write statements won't ever make it to the browser since you then
send a redirect. If you were to turn off buffering, you'd see that this
actually causes an error. You cannot send a redirect command to the browser
after sending back response text. So, no, you cannot do what you're trying
to do, exactly. You can do:
<% If Rs.eof Then
Session("Authenticated") = 0
%>
Sorry, your userid or password did not match<br>or you have not registered
yet. Please register.
<a href="login.asp">Click me</a>
Ray at work
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
Hi,
I have the following code as a part of authenticating a system.
If Rs.eof Then
Session("Authenticated") = 0
Response.Write "Sorry, your userid or password did not match"
Response.Write "<BR>"
Response.Write "or you have not registered yet. Please register"
Response.Redirect("login.asp")
Else
Session("Authenticated") = 1
Response.Redirect ("Welcome.asp")
End If
In the first if statement, I would like to display the above messages
before forcing the login.asp page to display. Is is possible to do both
message and contents of login.asp in the same page? Thanks