1
Vote

Image Thumbs

description

I can't get the Thumbs control to work with a listview bound to an object data source:
<ItemTemplate>
                    <td id="Td1" runat="server" height="175px" style="">
                    <%--<manic:Thumb ID="Thumb1" runat="server" 
                    ImageUrl='~/Photos/<%#Eval("Directory.Name")%>/<%#Eval("Name")%>' 
                    HyperlinkTarget="_blank" 
                    HyperlinkUrl='~/Photos/<%#Eval("Directory.Name")%>/<%#Eval("Name")%>' 
                    ImageWidth="100" ImageQuality="75" />--%>
                    <a href='../Photos/<%#Eval("Directory.Name")%>/<%#Eval("Name")%>' target="_blank">
                    <img src='../Photos/<%#Eval("Directory.Name")%>/Thumbs/<%#Eval("Name")%>' width="100" alt="" /></a>
                        <br />
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                    </td>
                </ItemTemplate>
 
The listview works fine with the uncommented markup shown above , but the ManicThumb image urls do not map correctly with the binding expression syntax for the Manic markup show in the commented portion above. The image place holders appear in the listview, but not the Thumbs.
 
Page source view HTML for one image of the list:
 
<span id="ctl00_MainContent_ListView1_ctrl1_Thumb1"><a href="../Photos/%3C%25#Eval(%22Directory.Name%22)%25%3E/%3C%25%23Eval(%22Name%22)%25%3E" target="_blank"><img src="../Thumb.axd?a=aIS5MJ1bSBC7pGzdr23M4KlOX4FCS3E7UZyk8xlr0JxkKjcYLTdiBMo7DfqH9O6SkzLITWnQZX4=&b=100&c=0&d=75&e=%23FFFFFF" alt=""/></a></span>

comments

ManicStudio wrote Feb 25, 2010 at 6:41 AM

I dont think your binding expression is correct. Try this:

ImageUrl='<%#Eval("Directory.Name", "~/Photos/{0}/") & Eval("Name")%>'

richardebel wrote Feb 26, 2010 at 8:47 PM

Thanks, that worked, except with C# I must use + instead of & for string concatination.

richardebel wrote Feb 26, 2010 at 9:00 PM

It now works with the binding expression which you suggested, but only if I remove the Crypt from the Thumbs source and the Decrypt from ThumbHandler source. With crypt, the thumb doesn't display, but the hyperlinked image does display.

ManicStudio wrote Feb 27, 2010 at 8:16 AM

It must work with crypted string, there is no reason not to work. Check again your binding expressions. I use that control in grid and listview on several sites and it works fine.

wrote Feb 1, 2013 at 9:44 PM