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!

hide part of asp code if session is null

Status
Not open for further replies.

aonefun

Technical User
May 21, 2007
79
US
I would like to have the following code show only if Session("PostalCode") is not null. I suppose I should put it into an If statement?

I tried it as follows but it does nothing:

If Session("PostalCode")<>"" Then
WADbSearch1_whereClause=BuildFilterString("LATITUDE","" & cStr( Session("HighLatitude") ) & "","AND","<=",1,WADbSearch1_wildCard,WADbSearch1_dateSeparator,WADbSearch1_whereClause)
WADbSearch1_whereClause=BuildFilterString("LATITUDE","" & cStr( Session("LowLatitude") ) & "","AND",">=",1,WADbSearch1_wildCard,WADbSearch1_dateSeparator,WADbSearch1_whereClause)
WADbSearch1_whereClause=BuildFilterString("LONGITUDE","" & cStr( Session("LowLongitude") ) & "","AND",">=",1,WADbSearch1_wildCard,WADbSearch1_dateSeparator,WADbSearch1_whereClause)
WADbSearch1_whereClause=BuildFilterString("LONGITUDE","" & cStr( Session("HighLongitude") ) & "","AND","<=",1,WADbSearch1_wildCard,WADbSearch1_dateSeparator,WADbSearch1_whereClause)
End If
 
Null and empty string are two different issues. If you want to check for null values, try this:
Code:
If not isnull(Session("PostalCode")) Then

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top