Request.Form sometimes returns a flag value, in other cases

Does anyone know what happened to this? I have a classic ASP code that checks the value of a checkbox, for example:

<!-- HTML page: page1.asp --->
<input id="useBilling" name="useBilling" value="Y" type="checkbox" />

And on my code page (let her call page2.asp):

' code

useBilling = Request.Form("useBilling")

' useBilling should be "Y" here

If useBilling = "Y" Then
    ' using billing info
Else
    ' not using billing info
End If

The problem is that sometimes even when the checkbox is checked, it passes an empty string to Request.Form and the wrong code is executed. I put a few calls to Response.Write to track it (this is VBScript, remember), and sometimes it says that the value is "Y", but later, when I check the value in the conditional, it is empty.

, , , , , , Request.Form , , . , , , , "Y", , , .

: , Response.End , , , Response.End, ( ), ( .End uncommented) ", ". Response.End , : " ".

( "Y", , , ). , , Response.End "Y", Response.End, .

+3
2

, , , , , Request.Form , .

, , : Request.Form( "useBilling" ) , . " " , , , . , , .

, , ASP 10 (, .) , , . !

, , HTML (, ) . - ?

Request.Form, - , ..

If useBilling = "Y" Then
  Response.Write "Cool, it works!"
Else
  Response.Write "Something weird. " & Request.Form
End If
+3

, , - , "on"

-1

All Articles