Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2008, 05:59 AM
Registered User
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Eval ImageUrl doesn´t work

Hi guys.

I´m on chapter 7 - Reading Data

and i can´t put the command
<asp:Image ID="Image2" ImageUrl='<%# Eval("PictureURL","~/MatchImages/{0}") %>' runat="server" /> work!

I want to read the name of a file on database and then see the image on the ImageControl.

If i do this:
<asp:Image ID="Image1" ImageUrl="~/MatchImages/aaronson.jpg" runat="server" /> i can see the image

and if i to this:
<asp:DataList ID="DataList1" runat="server" DataKeyField="PictureID" DataSourceID="SqlDataSource1">
            <ItemTemplate>
                <br />
                PictureURL:
                <asp:Label ID="PictureURLLabel" runat="server" Text='<%# Eval("PictureURL") %>'></asp:Label><br />
                <br />
            </ItemTemplate>
        </asp:DataList>
         i can see the name of the image.

Thanks in advance for your help.

Best Regards

 
Old May 23rd, 2008, 05:57 AM
Authorized User
 
Join Date: Sep 2007
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'd like to say I've spotted an error, but no sorry I can't see what the problem is. I compared your code with the grey code block and its explanation below on p242 of the book, and checked the errata.

The problem I had with that exercise is that I could only display one image regardless of the settings of the Repeat... attributes. I found that there was only a single entry in the Gallery table!

Richard
Rugeley, UK
WinXP Pro SP2
VBW Express + SQL Server 2005 Express





Similar Threads
Thread Thread Starter Forum Replies Last Post
ImageUrl syntax almotions ASP.NET 2.0 Basics 2 January 24th, 2008 03:47 AM
Databinding the ImageURL Prop of an Image Control Aaron Edwards ASP.NET 2.0 Professional 1 November 22nd, 2007 12:53 PM
RountingSlip doesn´t work Ravel99 Pro VB 6 0 April 26th, 2006 08:33 AM
Session_OnEnd doesn´t work Adlorenzo ASP.NET 1.0 and 1.1 Professional 7 May 22nd, 2004 04:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.