Link to home
Start Free TrialLog in
Avatar of EvanL
EvanL

asked on

Using IIf with Server.Encode

I've got this line:
<TD BORDERCOLOR=#c0c0c0 width="645" ><font color="#000000" face="Verdana" size="1"><%=Server.HTMLEncode(rs.Fields("ProgTitle").Value)%></font></TD>

I need to add an IIf in there that says, "if the Value of the field is Null, then make it equal to " ", else make it equal to the Value."
ASKER CERTIFIED SOLUTION
Avatar of CoolAss
CoolAss

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CoolAss
CoolAss

BTW, if for some reason this data can be a zero length string, yet not be Null, use this:

<%if IsNull(rs.Fields("ProgTitle")) then Response.Write(" ") else Response.Write(rs.Fields("ProgTitle")) end if%>

But chances are, the first post is what you want.







Avatar of EvanL

ASKER

Thanks for the post.  I'll try this tonight when I get home from work and report findings back here.
Avatar of EvanL

ASKER

Sorry for the delay.  Had to go out-of-town unexpectedly.

This works great.  Thanks for the help.