Sorry I messed up some of the label name and I forgot to check one more condition. Here is a completed one:
Sorry I was out for the past few days.
Here are the data type and values in the database: Column1: int, values (0,1) Column2: bit, values (0,1,null)
Here is the condition:
If "Column1" = 0 then display "Dave" (regardless of whatever column2 value is. In other words, no need to check for Column2 value)
If "Column1" = 1 and ("Column2" = 0 or IsNullOrEmpty) display "Mary"
If "Column1" = 1 and "Column2" = 1 display "Omar"
Data in db:
===================
Column1 Column2
0 0
0 NULL
1 NULL
1 1
1 0
Correct display / expected output:
On the aspx web page, I have a table with one column like below:
Dave or Mary or Omar ================== Dave Dave Mary Omar Mary
Current display based on the code below (wrong)
Dave or Mary or Omar ================= Dave Dave Mary Omar Omar (this is wrong. It should be "Mary")
Code below:
<asp:TemplateField HeaderText="Dave or Mary or Ox">
<ItemTemplate>
<asp:HyperLink runat="server" ID="h1" NavigateUrl="www.yahoo.com" Visible='<%# Convert.ToInt32(Eval("Column1")) <= 0? true : false %>' Text="Dave">
</asp:Hyperlink>
<asp:Label Visible='<%# String.IsNullOrEmpty(Convert.ToString(Eval("Column2"))) && Convert.ToInt32(Eval("Column1")) >=1 ? true : false %>' Text="Mary" runat ="server" />
<asp:Hyperlink runat="server" ID="h2" NavigateUrl="www.google.com" Visible='<%# !String.IsNullorEmpty(Convert.ToString(Eval("Column2"))) && Convert.ToInt32(Eval("Column1")) >=1 ? true :false %>' Text ="Omar">
</Hyperlink>
</ItemTemplate>
<asp:TemplateField>
Thanks so much.