satya kishore

satya kishore

  • NA
  • 7
  • 9.9k

Image not displaying in grid view

Mar 25 2009 7:40 AM

I have table in sql. in that table i have three fileds they are image name,image type,imagepath

i binded the grid view with this table . my table contains only image path ,but the image is saved at the applications folder.

 in the run time iam getting all fields but image is not displaying .hw to display that image using Imagepath field/.

my code is

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">

<Columns>

<asp:BoundField DataField="imagename" HeaderText="Image name" />

<asp:BoundField DataField="imagefile" HeaderText="Image file" />

<asp:BoundField DataField="imagetype" HeaderText="Image type" />

<asp:BoundField DataField="imagepath" HeaderText="Image path" />

<asp:TemplateField>

<ItemTemplate>

<asp:ImageButton id="ImageButton4" CommandName="Enlarge3" runat="server" Height="30" Width="30" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"imagepath") %>'/>

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

please verify that code and help me...

Thanks in advance

regards

satyakishore

 


Answers (1)