Display Images in DetailsView control |
Answered By
Moderator1
on
1/30/2010 9:09:11 PM |
|
|
Hi,
Place a Image control inside the DetailsView control, then bind the ImageUrl property with the ImageUrl you stored in the Image Details table. The query to return the product details should be joined with the Image details table as follows,
Select * from productdetails pro inner join imagedetails img on pro.id=img.id where pro.id="Pass your Product Id here." |
|
|
Re: |
Answered By
Shanu_Sudha
on
2/1/2010 11:44:29 PM |
|
|
Hi.. First, Thank You..
I've already done this way which u have mentioned..
Sample :
<asp:image id="myimage" runat="server"
imageurl='<%# Eval("img_Name", "path/to/image/{0}") %>' />
Procedure:
Select * from Store_Products SP inner join Image img on SP.Prod_ID=img_ProdID where SP.Prod_ID=1
But I can't get the image... |
|
|
Make sure your ImageUrl is correct |
Answered By
Moderator1
on
2/4/2010 9:59:39 PM |
|
|
Hi,
I checked your ImageUrl value. The syntax is correct, but make sure your image path "path/to.." is correct. My sample code is below,
<asp:Image ID="Image1" runat="server" Height="100px" ImageUrl='<%# Eval("ImgPath", "Images/{0}") %>' Width="100px" /> |
|
|