First, turn option explicit ON!!! Part of your problem is that you don't
seem to understand data types. All data in the Request is text. After all,
the Request message from the browser is pure text. Obviously, you can't add
the string "3" and the string "4" regardless of how numeric they may appear
to the human eye. They are text strings. In VB.Net, the "+" operator doubles
as both addition (for numbers) and concatenation (for strings). The run-time
compiler is smart enough to figure out whether you're dealing with strings
or numbers, and in this case, it is correct - they are strings.
By turning option explicit ON, you force yourself to strongly type all of
your variables, thus preventing a lot of similar mistakes, which may be hard
to track down when debugging.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"me2" <an*******@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
greetings,
im having problem with adding to values in asp
the sample code : <% = Request("Travelling") + Request("Photographs") %>
Let say travelling is 3 and photographs is 4, i get the answer 34.
Please guide. tq in advance.
** anyhow the same code works fine for all the other operators like "-" ,
"/" . "*" and so on.