asp.net - List View displaying Pictures -
I am using a list view control to display pictures with descriptions and captions. I was used to save the entire path of the image in the url area, so when I display them in the list view, I do not need to edit anything. I am now using something like this:
httpxx Present. Surp.mappath ("~ / photo /") + saved URL I list view your images to show this?
When I manipulate the contents of GridView's road databong event like: GridView used to do the same way:
dim photo as new image photo .imageUrl = "~ / Photos /" + e.row.Cells (TheCellNumber). Text e Ro Seals (0). Controls. Clear () E. Ro Seals (0). Control. Add (photo)
Why do not you use image control in the item template:
& lt; Asp: ListView id = "ListView1" runat = "server" DataKeyNames = "pictureId" & gt; & Lt; ItemTemplate & gt; & Lt; Asp: Image ID = "PictureControlID" runat = "server" Alternate text & # ImageUrl = '& lt;% #' ~ / photos / "+ Eval (" Picture ")%> & gt; '/ & gt; & lt; / ItemTemplate & gt; & lt; / ASP: ListView & gt;
Comments
Post a Comment