I need help with an IIF statement in ASP.Net.
The line of code: <%# IIF(Container.DataItem("PublicEmail") = False,"<p><font face=sans-serif color=#330099><b>Name:</FONT></b> <a href='mailto:" & Container.DataItem("Email") & "'>" & Container.DataItem("Name") & "</a>", "") %> works fine.
However, I would like to be able to display the name without being hyperlinked to an email address.
I tried the following line of code: <%# IIF(Container.DataItem("PublicEmail") = False,"<p><font face=sans-serif color=#330099>Name:</FONT> <FONT face=sans-serif>& Container.DataItem("Name") & "</font>", "")%>
This is the line of code I need help with. It's a problem with the syntax. Please look at the red part.
Here's a copy of the error message that I got on that line:
Compiler Error Message: BC30455: Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.
Source Error:
|
Line 160: <tr valign="top">
Line 161: <td> <%# IIF(Container.DataItem("PublicEmail") = True,"<p><font face=sans-serif color=#330099><b>Name:</FONT></b> <a href='mailto:" & Container.DataItem("Email") & "'>" & Container.DataItem("Name") & "</a>", "") %>
Line 162: <%# IIF(Container.DataItem("PublicEmail") = False,"<p><font face=sans-serif color=#330099>Name:</FONT> <FONT face=sans-serif>& Container.DataItem("Name") & "</font>", "")%>
|