Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem comparing Session to QueryString 1

Status
Not open for further replies.

ecobb

Programmer
Dec 5, 2002
2,190
US
I have a simple IF statement that is supposed to compare a session variable to a querystring, but it doesn't seem to be working. If I write the vars just before the comparison, the are identical but the IF statement never returns true.
Code:
	response.write Session("Cal_UserID") '-Returns 12345'
	response.write Request.QueryString("schoolid") '-Returns 12345'
    If Session("Cal_UserID") = Request.QueryString("schoolid") then...
Since this is my first ASP project, I'm sure there's something I'm overlooking. Any ideas?

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Hi

Try this

If trim(Session("Cal_UserID")) = trim(Request.QueryString("schoolid")) then...

It could be that one of the values as leading or trailing blanks.

--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top