title: If Statement in ASP.NET Gridview "ShowEditButton"
body: <p>I have a question for you regarding ASP.NET's GridView and performing an If Statement when it comes to the commandfield for the "Edit" button.</p>
  
  <p>Here is the code I have right now:</p>
  
  <pre><code> &lt;Columns&gt;
  
         &lt;% if (Eval("Session("auditUpdate")") == true) { %&gt;
              &lt;asp:CommandField ShowEditButton="True" /&gt;
          &lt;% } %&gt;
  
          &lt;asp:BoundField DataField="MODEL_NUMBER" HeaderText="MODEL_NUMBER" 
              ReadOnly="True" SortExpression="MODEL_NUMBER" /&gt;
   &lt;/Columns&gt;
  </code></pre>
  
  <p>I have a session boolean variable named auditUpdate that I am updating in the "OnRowDataBound" event for the GridView.  I want to show the edit button if 'auditUpdate' == true otherwise not show it at all.</p>
  
  <p>I have searched all over and scoured my ASP.net book but I cannot seem to find the answer.</p>
  
  <p>Thanks!</p>