I have a repeater. In that repeater a certain value may or not be null. My
problem is I need to send the repeater value into a function, if there is a
value display it otherwise display nothing. Problem is, works if I cast to
DBNULL but only if the item really is null. The code is below which might
help.
------------------------------------------------
<table width="100%">
<asp:Repeater id="customer" runat="server">
<ItemTemplate>
<tr>
<td class="body">
<strong>
<%# Container.DataItem("name")%><br>
<%# isThereCompany(Container.DataItem("company")) %> ------AN EXAMPLE WHERE
THE PROBLEM LIES. I COULD JUST DISPLAY THIS IN NORMAL CONTAINER BUT I DON'T
WANT THE "<BR>"
<%# Container.DataItem("billing_address")%><br>
<%# Container.DataItem("billing_city")%>, <%#
Container.DataItem("billing_state")%>
<%# Container.DataItem("billing_zip")%><br><hr><br>
E-Mail: <%# Container.DataItem("email")%><br>
Phone: <%# Container.DataItem("phone")%><br><hr><br>
<%# isThereShip(Container.DataItem("shipping_address"),
Container.DataItem("shipping_city"), Container.DataItem("shipping_state"),
Container.DataItem("shipping_zip")) %>
Card Issuer: <%# Container.DataItem("cc_type")%><br>
Name on card: <%# Container.DataItem("cc_name")%><br>
Credit Card #: <%# Container.DataItem("cc_number")%><br>
Exp Date: <%# Container.DataItem("cc_exp")%><br>
V-Code: <%# Container.DataItem("cc_vcode")%><br><hr><br>
<%# isThereHowHear(Container.DataItem("how_hear")) %>
<%# isThereComments(Container.DataItem("comments")) %>
</strong>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
------------------------------------------------
CODE BEHIND:
' IF I CAST THIS AS STRING, IT ERRORS IF THERE IS NO VALUE, BUT IT WORKS IF
THERE IS NO VALUE
Public Function isThereCompany(ByVal strValue As DBNull)
Dim strTest As String
If Not strValue Is DBNull.Value Then
strTest = strValue & "<br>"
Return strValue
Else
strTest = "<br>"
Return strTest
End If
End Function
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/