473,322 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Response.Status

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
Jul 19 '05 #1
5 7186
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

"Kevin Jackson" <kj******@powerwayinc.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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

Jul 19 '05 #2
> there is no Response.Status method.

That is correct. However, there is a response.status *property* in IIS 5.0
and above.

http://msdn.microsoft.com/library/en..._vbom_reso.asp
http://msdn.microsoft.com/library/en...esopstatus.asp

You should read the docs before stating "facts"...
Jul 19 '05 #3
I believe if you look at the methods for Response you will see there IS a
Response.Status method

"Lin Ma" <abc.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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

"Kevin Jackson" <kj******@powerwayinc.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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


Jul 19 '05 #4
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
"Kevin Jackson" <kj******@powerwayinc.com> wrote in message
news:#S**************@TK2MSFTNGP12.phx.gbl...
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

Jul 19 '05 #5
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/se...s/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."

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim Flath | last post by:
I have a situation when I need to set the response status code to a non 200 and then serve up a generic error page (html page not a jsp). I can successfully call response.setStatus(...
8
by: Jazzis | last post by:
If I want to execute an ASP page and get NOTHING in return, no HTL Headers as well? response.clear clears only the contents, but HTML Header is still returned. Thanks for your time. Adam
7
by: Stephanie | last post by:
If response.buffer is set to true, and no response.flush has been executed, is it accurate to expect that my browser should not be rendering the content which I (well Ok, someone else) is sending...
2
by: Peter Rilling | last post by:
I am trying to use an HttpWebRequest object to get resource from a website. Now, some of the files that I try to get may not exist. I would like to check for that condition. When I call...
4
by: Chris Fink | last post by:
How do I retrieve the HTTP Status code (ie 202, 404, etc) below? I am currently receiving the response text but unable to access the response status code. string strNewValue; string...
4
by: Hexman | last post by:
Code below ---- I've asked a similar question on this forum earlier. This is a slightly different situation. Previous Question ---- I'm trying to save some specific web pages to disk as...
12
by: gigi | last post by:
How to send more than one value using response redirect? For example i can send one like this response.Redirect "pregled.asp?ime=" & strUserName but how to send two or more values? I tried...
2
by: Zester | last post by:
Hi, Sorry for this multi-posts; I don't know where the setting if it exists so I'm posting this to multiple groups. I was told that Response.Redirect would generate the http 302 Object Moved...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.