Showing posts with label If Condition in GridView. Show all posts
Showing posts with label If Condition in GridView. Show all posts

If condition in Repeater,Listview

while binding data in repeater i need to do a if condition in the same repeater, so i use below one.

<ItemTemplate>
     <table>
              <div id="Div1" runat="server" visible='<%#Eval("TextA") !="" %>'> //  true or false
                 <tr>
                      <td style="width:120px;">
                       <asp:TextBox ID="TextBox1" Text='<%#Eval("AnimalGroup") %>' Width="100" runat="server"></asp:TextBox>                                          
                       </td>
                        <td style="width:100px;">
                       <asp:TextBox ID="txtQno" Text='<%#Eval("QNO") %>' Width="100" runat="server"></asp:TextBox>
                     </td>
                      <td style="width:500px;">
                         <asp:TextBox ID="txtTextA" Text='<%#Eval("TextA") %>' Width="500" runat="server"></asp:TextBox>                                          
                         </td>
          </tr></div>
       </table>
 </ItemTemplate>


Its working fine..... Thanks