Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Assignment doesnt assign???

Reply
Thread Tools

Assignment doesnt assign???

 
 
Tim Slattery
Guest
Posts: n/a
 
      03-03-2006
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)
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      03-03-2006

Tim Slattery wrote:
> 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)
> (E-Mail Removed)



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

 
Reply With Quote
 
 
 
 
Roland Hall
Guest
Posts: n/a
 
      03-04-2006
"Tim Slattery" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
: 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


 
Reply With Quote
 
Tim Slattery
Guest
Posts: n/a
 
      03-06-2006
"Roland Hall" <nobody@nowhere> wrote:

>"Tim Slattery" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed).. .
>: 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
(E-Mail Removed)
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      03-06-2006
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"


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      03-06-2006
Bob Barrows [MVP] wrote:
> 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"


 
Reply With Quote
 
Tim Slattery
Guest
Posts: n/a
 
      03-06-2006
Tim Slattery <(E-Mail Removed)> wrote:

>"Roland Hall" <nobody@nowhere> wrote:
>
>>"Tim Slattery" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed). ..
>>: 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
(E-Mail Removed)
 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      03-08-2006
"Tim Slattery" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
: Tim Slattery <(E-Mail Removed)> wrote:
:
: >"Roland Hall" <nobody@nowhere> wrote:
: >
: >>"Tim Slattery" <(E-Mail Removed)> wrote in message
: >>news:(E-Mail Removed). ..
: >>: 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort list doesnt work, key=str still doesnt work notnorwegian@yahoo.se Python 3 05-27-2008 04:32 AM
Assignment operator self-assignment check Chris C++ 34 09-26-2006 04:26 AM
PC doesnt boot first time and doesnt shutdown dann Computer Support 6 08-21-2006 07:31 AM
Augument assignment versus regular assignment nagy Python 36 07-20-2006 07:24 PM
wireless connection properties doesnt show wireless network tab =?Utf-8?B?QXVkcmV5?= Wireless Networking 4 08-22-2004 06:11 PM



Advertisments