gridview with image display

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yogarajan
    New Member
    • Apr 2007
    • 115

    gridview with image display

    Hi All
    Code:
                <asp:TemplateField HeaderText="homeimg" SortExpression="homeimg">
                    
                    <ItemTemplate>
                        &nbsp;<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("homeimg,productid", "Images\\productimg\\{1}\\ThumbnailImage\\{0}") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
    i want pass 2 values how can i pass 2 value in image url

    now i got error
    pls help me

    Thanks
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    RE:gridview with image display

    didn't got the question really explain properly what do you want....

    Comment

    • yogarajan
      New Member
      • Apr 2007
      • 115

      #3
      Re:

      Hi
      Thanks for ur reply

      i want display image in my grid


      My table have 2 fields (Productid- Unique , Auto number; Homeimg- String)
      look like this

      Product id homeimg
      1 cat.jpg
      2 cow.jpg
      3 dog.jpg

      my image folder structure
      1. Images(Parent folder name)
      1.1 productimg(chil d folder name)
      1.1.1 1 (First Child child folder name)
      1.1.1.1 cat.jpg (Image file)
      1.1.2 2 (Second Child child Folder name)
      1.1.2.1 Cow.jpg (Image file)
      1.1.3 3 (Third Child child folder name)
      1.1.3.1 dog.jpg (image file )
      my image path like this

      images/productimg/1(Productid field )/cat.jpg(homeimg- field name)
      images/productimg/2(Productid field )/Cow.jpg(homeimg- field name)
      images/productimg/3(Productid field )/dog.jpg(homeimg- field name)


      how can i get two values in grid


      Code:
          
                     <asp:TemplateField HeaderText="homeimg" SortExpression="homeimg">
          
                         <ItemTemplate>
                             &nbsp;<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("homeimg,productid", "Images\\productimg\\{1}\\ThumbnailImage\\{0}") %>' />
                         </ItemTemplate>
                     </asp:TemplateField>

      Comment

      Working...