vb.net inline IF with OR... not evaluating

Posted by rockinthesixstring on Stack Overflow See other posts from Stack Overflow or by rockinthesixstring
Published on 2010-03-30T00:23:02Z Indexed on 2010/03/30 0:33 UTC
Read the original article Hit count: 293

Filed under:

I'm working on a small problem where I'm trying to show/hide a panel based on two criteria

  1. A specific data field must not be blank
  2. The specific data filed must also not equal "Not Relocatable"

Unfortunately this doesn't seem to be working for me (note that setting either one or the other criteria works just fine.)

        <asp:Panel runat="server" Visible='<%#If(Not String.IsNullOrEmpty(DataBinder.Eval(Container.DataItem, "_236")) Or Not DataBinder.Eval(Container.DataItem, "_236") = "Not Relocatable", True, False)%>'>
        <tr>
            <td>
            </td>
            <td class="align-right lightgreen">
                Buyer would consider relocating a business, if it is:
            </td>
            <td>
            </td>
            <td colspan="3">
                <%#DataBinder.Eval(Container.DataItem, "_236")%>
            </td>
            <td>
            </td>
        </tr>
        </asp:Panel>

Can anyone lend a hand to rectify this problem for me?

© Stack Overflow or respective owner

Related posts about inline-if