Search
Winners

Win Prizes

Social Presence
Like us on Facebook
Advertisements
Ads

Use of IIF Keyword

vishalneeraj-24503
Posted by vishalneeraj-24503 under ASP.NET on 11/12/2013 5:31:26 AM | Points: 75 | Views : 2571 | Status : [Member] [MVP]

Suppose, you have a table called Employee_Master and it contains one Status column. and status column contains
AA/DD as a text which shows Active/De-active employees.

If you are using Gridview and you want to show Active/De-active in Gridview Status Column then, either you will write a code in Gridview' RowDataBound event or you will directly write in aspx page in Itemtemplate as shown:-

<asp:gridview id="gd_employee" runat="server">
   <column>
      <templatefield headertext="Employee Status">
           <itemtemplate>
                 <asp:label id="lbl_employee_status" runat="server" Text =  '<%#IIF(Eval("Status").Tostring()="AA","Active","De-active") %>'
           </itemtemplate>
      </templatefield>
   </column>
</asp:gridview>



Comments or Responses


Login to post response