Forum Moderators: open

Message Too Old, No Replies

if 1 = 1 conditional classic asp

conditional statement

         

KRMwebdesign

12:49 pm on Apr 21, 2011 (gmt 0)

10+ Year Member




Hi All,
I am trying to match a session value to the URL value. So the logic is "if 8 = 8 then (show 1) else (show 2). So I have:

<% if (session("myID")) = (request.QueryString("membersID")) then %> your profile <% else %> not your profile <% end if %>

but for some reason, although both values are the same (which should lead to (show 1) they keep leading to (show 2) as above. Can anyone tell me what I'm doing wrong? I bet it's something really simple isn't it?

Please help! :S

Ocean10000

1:11 pm on Apr 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Cast the Session object to a string should do it.
<% if cstr(session("myID")) = request.QueryString("membersID") then %> your profile <% else %> not your profile <% end if %>

KRMwebdesign

1:21 pm on Apr 21, 2011 (gmt 0)

10+ Year Member



Hi Ocean10000,
That worked beautifully! Thanks for your help :)