Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. need help wit my datagrid's image

need help wit my datagrid's image

Scheduled Pinned Locked Moved ASP.NET
databasesysadminhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neodeaths
    wrote on last edited by
    #1

    hi i am currently trying to use a gridview control to view data from the database. however one of the field is an image. the format i need to display is: id(labelbox),image(imagebox) but in the database my data is saved as id(text),pic(text,image name only like asd.jpg) however my image is all in the image folder... meaning i am trying to configure the imagebox in the gridview control to add the "image/" in front of the now image name. <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pic") %>' Height="100px" Width="100px" /> this is what i got after changing the coulum to a template now the imageurl is like imageurl="asd.jpg" how ever i need it to be imageurl="image/asd.jpg" is there anyway to do this without on the below code? <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pic") %>' Height="100px" Width="100px" />

    D 1 Reply Last reply
    0
    • N neodeaths

      hi i am currently trying to use a gridview control to view data from the database. however one of the field is an image. the format i need to display is: id(labelbox),image(imagebox) but in the database my data is saved as id(text),pic(text,image name only like asd.jpg) however my image is all in the image folder... meaning i am trying to configure the imagebox in the gridview control to add the "image/" in front of the now image name. <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pic") %>' Height="100px" Width="100px" /> this is what i got after changing the coulum to a template now the imageurl is like imageurl="asd.jpg" how ever i need it to be imageurl="image/asd.jpg" is there anyway to do this without on the below code? <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pic") %>' Height="100px" Width="100px" />

      D Offline
      D Offline
      dwatkins dirq net
      wrote on last edited by
      #2

      you need to do this in the eval statement (from memory): ImageUrl='<%# "image/" + Eval("Pic") %>'

      Dirk Watkins

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups