PDA

View Full Version : hiding empty data fields


mangeloni
12-19-2002, 01:36 AM
I know that to hide empty data fields (ASP, JS)...

<% if (rsName.Fields.Item("extension").Value != null) { %>
<TR>
<TD>Extension</TD>
<TD><%=(rsName.Fields.Item("extension").Value)%></TD>
</TR>
<% } %>


However, I am not getting the data from a Record Set but from a Session Variable - is there a way to modify the above code to accomodate this or is there other code altogether?

(Using UltraDev)

Thanks!

-MVA

whammy
12-19-2002, 01:56 AM
Yeah...

If Session("whatever") <> "" Then
'do something
End If

P.S. You should have posted this in the ASP forum. :)

mangeloni
12-19-2002, 03:27 AM
Whammy---

Sorry, I am new to actually coding things myself...so your reply was rather criptic for my 'newbie' brain. Can you clarify more? Also, I was told this was JavaScript so that is why I went to this board.

Thanks again for your help!

-MA

whammy
12-20-2002, 12:57 AM
I'm not sure of ASP/JavaScript syntax, as I code in ASP using ASP/VBScript, and so do the majority of ASP developers, but this works for me testing locally with PWS:


<%@ Language="JScript" %>
<%
Session("blah") = "myvariable"
if(Session("blah") != "") {
Response.Write("This is some HTML!");
}
%>


Hope this helps! :)