Welcome to WebmasterWorld Guest from 34.229.24.100

Forum Moderators: ocean10000

Message Too Old, No Replies

if 1 = 1 conditional classic asp

conditional statement

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

Junior Member

5+ Year Member

joined:Sept 11, 2009
posts: 108
votes: 0



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
1:11 pm on Apr 21, 2011 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


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 %>
1:21 pm on Apr 21, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Sept 11, 2009
posts: 108
votes: 0


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