Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in the image control i m bind with logo column but it can't bind and there is no image in gridview
XML
<Columns>

         <asp:TemplateField>

             <ItemTemplate>
             <table>
              <tr>
                 <td rowspan="4">
                     <big><asp:Image ID="Image1" runat="server"  ImageUrl ='<%# Eval("Logo") %>'</big></big>
                         Width="75px" /> </td>
                 <td>
                     <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label></td>
                 <td rowspan="4">Address:-
                     <asp:Label ID="Label2" runat="server" Text='<%# Bind("Address") %>'></asp:Label></td>
             </tr>
             <tr>
                 <td>Contact:-
                      <asp:Label ID="Label3" runat="server" Text='<%# Bind("Contact") %>'></asp:Label></td>
             </tr>
             <tr>
                 <td>Class:-
                      <asp:Label ID="Label4" runat="server" Text='<%# Bind("ClassName") %>'></asp:Label></td>
             </tr>
             <tr>
                 <td>City:-
                      <asp:Label ID="Label5" runat="server" Text='<%# Bind("City") %>'></asp:Label></td>
             </tr>

                </table>
             </ItemTemplate>
         </asp:TemplateField>

     </Columns>
Posted

1 solution

In principle this should work. Check that an image actually exists at <%# Eval("Logo") %> and use a browser to look at the source html for the page to see that the value you are assigning to ImageUrl is being set correctly.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900