title: How to insert a hyperlink inside a ternary operator
body: <p>I have created a new project in asp.net and i'm struggling to insert a hyperlink inside a ternary operator.</p>
  
  <p><strong>Here is code snippet:</strong></p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"&gt;
     &lt;Columns&gt;
        &lt;asp:BoundField DataField="Id" HeaderText="Id" ItemStyle-Width="50" /&gt;
        &lt;asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" /&gt;
        &lt;asp:TemplateField HeaderText="Status" ItemStyle-Width="100"&gt;
          &lt;ItemTemplate&gt;
             &lt;a href='&lt;%# Eval("Status", "Questions/{0}.aspx") %&gt;'&gt;'&lt;%# Eval("Status") %&gt;'&lt;/a&gt;
             &lt;%# Eval("Status").ToString() == "A" ? "Absent" : "Present"  %&gt;
          &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
     &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>In this above code, if the Status is "A", i need to insert the hyperlink (<code>&lt;a href='&lt;%# Eval("Status", "Questions/{0}.aspx") %&gt;'&gt;'&lt;%# Eval("Status") %&gt;'&lt;/a&gt;</code>) in the place of "<code>Absent</code>". </p>
  
  <p><strong>Here is my Output:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/OZB9O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OZB9O.png" alt="enter image description here"></a></p>
  
  <p>How can i do this? Any advice would be healpful. Thank you.</p>
  
  <p><strong>Update #1</strong>:</p>
  
  <p>I need only the absent to be the link, for present, i'm just displaying it as a plain text.</p>
  
  <p><a href="https://i.stack.imgur.com/8C0hN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8C0hN.png" alt="enter image description here"></a></p>