Displaying Image URLs in database in Gridview

  • Thread starter Thread starter Fonz
  • Start date Start date
F

Fonz

Hello all,

I have a table I am linking to in Gridview. In the table is a field titled
URL. The data in this field are actual URL's that link to images external
from my site.

I would like to either modifyy the grid view to display both the URL and the
image that the URL links to within the grid for each record row, OR be able
to generate a table that populates 4 cells left to right with the image and
the data from other fields as it seems that gridview appears to have
limitations in this respect.

Thanks in advance to all who can help.
 
Hello all,

I have a table I am linking to in Gridview. In the table is a field titled
URL. The data in this field are actual  URL's that link to images external
from my site.

I would like to either modifyy the grid view to display both the URL and the
image that the URL links to within the grid for each record row, OR be able
to generate a table that populates 4 cells left to right with the image and
the data from other fields as it seems that gridview appears to have
limitations in this respect.

Thanks in advance to all who can help.

Just put an Image control and assign its source url from the database

<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="imgButton" runat="server" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "URL") %>' ></asp:Image>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Hope this helps
 
Back
Top