Displaying Image URLs in database in Gridview

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top