unable to get images in grid view

Posted by Deepakji under C# on 3/26/2012 | Points: 10 | Views : 1265 | Status : [Member] | Replies : 2
hi ,
how are you

i am able to display text in gridview but unable to display the image that's there along with the text in the grid so please let me know how can that be done i.e i want both image and text to be displayed in a cell and i need to capture text and image from sql server 2008




thanking you,




Responses

Posted by: Mahesh_Chs on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hii
Try this..

<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img1" runat="server" ImageUrl='<%#Eval("image") %>' Height="75px" Width="75px"/>
</ItemTemplate>
</asp:TemplateField>

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

You can write as follow in gridview
<Columns>
<asp:TemplateField HeaderText="Photograph">
<ItemTemplate>
<<%# Eval("Address") %>> <asp:Image runat="server" ID="imgphotograph" ImageUrl='<%# Eval("Imagepath") %>'
Height="100" Width="100" />
</ItemTemplate>
</asp:TemplateField>
</Columns>

R D Patel

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response