Response.Status

K

Kevin Jackson

If I have something like this...

if Count > 0
Response.Status = "400"
else
Response.Status = "200"
end if

The status is always set to 400 even if count is zero...

Am I missing something?

Thanks
 
L

Lin Ma

I think you really want is this:

<%
count = 0

if count > 0 then
count = "400"
else
count = "200"
end if


response.write count 'display the result
%>

there is no Response.Status method.

Lin Ma
 
K

Kevin Jackson

I believe if you look at the methods for Response you will see there IS a
Response.Status method
 
C

Copa

For some reason the script engine may be looking at Count as a Text string
instead of a number. I just ran into this again today, to fix it i
converted both numbers to Longs while comparing them and this fixed the
problem, I am pretty sure if you do the same it will work properly.

And Response.Status will work just fine!

if cLng(Count) > clng(0)
Response.Status = "400"
else
Response.Status = "200"
end if
 
M

MSFT

Here is the complete code I tested, it seems to work:

Count=3

'Count=0

if cLng(Count) > clng(0) then
Response.Status = "400"
else
Response.Status = "200"
end if

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top