Monday, January 30, 2012

if condition in gridview source code page

if condition in gridview in source code or .aspx page
this will decrease many operation so performance increase. 
 
<Columns>
  <asp:TemplateField>
    <ItemTemplate>
      <asp:ImageButton ID="ifgridview" runat="server" 
         ImageUrl=<%# ((bool) Eval("condition"))? "yes.png":"no.png" %>
         OnClick="ifgridview_Click" />
    </ItemTemplate>
  </asp:TemplateField>
</columns>
ASPdotNET-Example