I have the following Repeater control. How can I test for null or an
empty field and then not write that field to the browser.
The following works for null but not for empty. Should I create a
function which will test each field?
<asp:Repeater id=3D"List" runat=3D"server">
<ItemTemplate>
<a href=3D"http://<%# Container.DataItem("URL") %>" target=3D"_blank" >
<%# Container.DataItem("CompanyName") %>
</a>
<%# DataBinder.Eval(Container.DataItem,"Address1", "<br>{0}") %>
<%# DataBinder.Eval(Container.DataItem,"Address2", "<br>{0}") %>
<%# DataBinder.Eval(Container.DataItem,"Phone_AreaCode", "{0}") %>
<%# DataBinder.Eval(Container.DataItem,"Phone", "{0}") %>
</ItemTemplate>
</asp:Repeater>
I need to do something like this:
If objRS("Phone2_AC") <> "" Then Response.Write "(" & objRS("Phone2_AC") &
") "
If objRS("Phone2") <> "" Then Response.Write objRS("Phone2") & "<br>"
Thanks
Mitch