Home All Groups Group Topic Archive Search About

Assignment doesnt assign???



Author
3 Mar 2006 8:12 PM
Tim Slattery
My ASP page contains the following VBScript code:
    <%
    zipCode = Request.Form("zip")
    %> <br>zip: <%= zipCode %>, rf: <%= Request.Form("zip") %>

When I enter "abc" into the "zip" field on the form, I get the
following output:

zip: , rf: abc

Why doesn't the first statement assign the "abc" string to the
variable "zipCode"? What am I not seeing?

--
Tim Slattery
MS MVP(DTS)
Slatter***@bls.gov

Author
3 Mar 2006 8:31 PM
Mike Brind
Tim Slattery wrote:
Show quote
> My ASP page contains the following VBScript code:
>     <%
>     zipCode = Request.Form("zip")
>     %> <br>zip: <%= zipCode %>, rf: <%= Request.Form("zip") %>
>
> When I enter "abc" into the "zip" field on the form, I get the
> following output:
>
> zip: , rf: abc
>
> Why doesn't the first statement assign the "abc" string to the
> variable "zipCode"? What am I not seeing?
>
> --
> Tim Slattery
> MS MVP(DTS)
> Slatter***@bls.gov


Works fine for me.  I get

zip: abc, rf: abc

using Windows XP Pro SP2, IIS 5, Firefox 1.5.0.5,  IE6 and Opera. 8.51.

How odd!

--
Mike Brind
Author
4 Mar 2006 5:07 AM
Roland Hall
Show quote
"Tim Slattery" <Slatter***@bls.gov> wrote in message
news:5h8h0297eima25agf0sdvf0g0ndddj2idq@4ax.com...
: My ASP page contains the following VBScript code:
:    <%
:    zipCode = Request.Form("zip")
:    %> <br>zip: <%= zipCode %>, rf: <%= Request.Form("zip") %>
:
: When I enter "abc" into the "zip" field on the form, I get the
: following output:
:
: zip: , rf: abc
:
: Why doesn't the first statement assign the "abc" string to the
: variable "zipCode"? What am I not seeing?

Is this all you have on the page and did you type it here or copy/paste?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Author
6 Mar 2006 5:21 PM
Tim Slattery
Show quote
"Roland Hall" <nobody@nowhere> wrote:

>"Tim Slattery" <Slatter***@bls.gov> wrote in message
>news:5h8h0297eima25agf0sdvf0g0ndddj2idq@4ax.com...
>: My ASP page contains the following VBScript code:
>:    <%
>:    zipCode = Request.Form("zip")
>:    %> <br>zip: <%= zipCode %>, rf: <%= Request.Form("zip") %>
>:
>: When I enter "abc" into the "zip" field on the form, I get the
>: following output:
>:
>: zip: , rf: abc
>:
>: Why doesn't the first statement assign the "abc" string to the
>: variable "zipCode"? What am I not seeing?
>
>Is this all you have on the page and did you type it here or copy/paste?

There's lots on the page, so *something* there must be non-kosher I
suppose, even though everything looks OK. Yes, I did copy and past
this. The line that dumps the values on the page starts with "%>" and
ends with "<%" because its a debug line that I stuck in the middle of
server-side code.

Regardless of what is going on elsewhere, I can't figure out why the
assignment (apparently) doesn't happen.

-- 
Tim Slattery
Slatter***@bls.gov
Author
6 Mar 2006 5:38 PM
Bob Barrows [MVP]
Tim Slattery wrote:
>
> There's lots on the page, so *something* there must be non-kosher I
> suppose, even though everything looks OK. Yes, I did copy and past
> this. The line that dumps the values on the page starts with "%>" and
> ends with "<%" because its a debug line that I stuck in the middle of
> server-side code.
>
> Regardless of what is going on elsewhere, I can't figure out why the
> assignment (apparently) doesn't happen.

Your best course of action is to create a small test page containing only
the bits needed to reproduce this particular symptom and post it here.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Author
6 Mar 2006 5:49 PM
Bob Barrows [MVP]
Bob Barrows [MVP] wrote:
Show quote
> Tim Slattery wrote:
>>
>> There's lots on the page, so *something* there must be non-kosher I
>> suppose, even though everything looks OK. Yes, I did copy and past
>> this. The line that dumps the values on the page starts with "%>" and
>> ends with "<%" because its a debug line that I stuck in the middle of
>> server-side code.
>>
>> Regardless of what is going on elsewhere, I can't figure out why the
>> assignment (apparently) doesn't happen.
>
> Your best course of action is to create a small test page containing
> only the bits needed to reproduce this particular symptom and post it
> here.

I should have added:
If you cannot reproduce your symptoms in the small test page, add stuff from
your problem page until the symptom appears.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Author
6 Mar 2006 6:10 PM
Tim Slattery
Tim Slattery <Slatter***@bls.gov> wrote:

Show quote
>"Roland Hall" <nobody@nowhere> wrote:
>
>>"Tim Slattery" <Slatter***@bls.gov> wrote in message
>>news:5h8h0297eima25agf0sdvf0g0ndddj2idq@4ax.com...
>>: My ASP page contains the following VBScript code:
>>:    <%
>>:    zipCode = Request.Form("zip")
>>:    %> <br>zip: <%= zipCode %>, rf: <%= Request.Form("zip") %>
>>:
>>: When I enter "abc" into the "zip" field on the form, I get the
>>: following output:
>>:
>>: zip: , rf: abc
>>:
>>: Why doesn't the first statement assign the "abc" string to the
>>: variable "zipCode"? What am I not seeing?

Found it. There was a tried-and-true, guaranteed to work ASP file
being included at the top of this thing. The first statement in that
file was "option explicit".

So if I simply "dim"  the variable "zipCode", it works fine. The
server admins apparently have some option set - or not set - so that I
get just about no ASP error messages, and I had *no* error message for
this thing.

-- 
Tim Slattery
Slatter***@bls.gov
Author
8 Mar 2006 12:30 AM
Roland Hall
Show quote
"Tim Slattery" <Slatter***@bls.gov> wrote in message
news:hiuo021ggosbnguhovhc74n3c1gpsl3qtj@4ax.com...
: Tim Slattery <Slatter***@bls.gov> wrote:
:
: >"Roland Hall" <nobody@nowhere> wrote:
: >
: >>"Tim Slattery" <Slatter***@bls.gov> wrote in message
: >>news:5h8h0297eima25agf0sdvf0g0ndddj2idq@4ax.com...
: >>: My ASP page contains the following VBScript code:
: >>:    <%
: >>:    zipCode = Request.Form("zip")
: >>:    %> <br>zip: <%= zipCode %>, rf: <%= Request.Form("zip") %>
: >>:
: >>: When I enter "abc" into the "zip" field on the form, I get the
: >>: following output:
: >>:
: >>: zip: , rf: abc
: >>:
: >>: Why doesn't the first statement assign the "abc" string to the
: >>: variable "zipCode"? What am I not seeing?
:
: Found it. There was a tried-and-true, guaranteed to work ASP file
: being included at the top of this thing. The first statement in that
: file was "option explicit".
:
: So if I simply "dim"  the variable "zipCode", it works fine. The
: server admins apparently have some option set - or not set - so that I
: get just about no ASP error messages, and I had *no* error message for
: this thing.

Good catch.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

AddThis Social Bookmark Button