Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 July 2nd, 2010, 03:05 PM
Authorized User
 
Join Date: Dec 2009
Posts: 63
Thanks: 18
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Wilfredo Rosado
Red face Image display problem

Hi Imar,

Do you know where I can find more information on eval() or its syntax?

I understand it is used to get the database fields as in eval("ImageUrl") to obtain the the URL for the image from the database table.

The reason I ask is that in my database I have two fields that make up the URL for the image. One I call Path and the other is Filename. On page 469, you use eval to obtain the ImageUrl, (which has the complete image URL in it. In mine, I have to string together eval("Path") and eval("Filename") and then I can assign them to the ImageUrl property of the Image control.

My two field contents resemble this:

Path: (nvarchar)
~/folder1/folder2/

Filename: (nvarchar)
Image1.jpg

I need it to be like this:

~/folder1/folder2/Image1.jpg

I imagine it is done in the code behind, but I'm not sure how.

Fred

Last edited by Wilfredo Rosado; July 2nd, 2010 at 03:13 PM..
 
Old July 2nd, 2010, 05:48 PM
Authorized User
 
Join Date: Aug 2009
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default

Here's a link to information about embedded code blocks:

http://msdn.microsoft.com/en-us/libr...35(VS.90).aspx

And here's a link to information about the Eval() function
http://msdn.microsoft.com/en-us/libr...al(VS.90).aspx

To do what you'rr asking for would probably look something like this:
<%# Eval("Path") + Eval("Filename") %>
The Following User Says Thank You to Pegasus40218 For This Useful Post:
Wilfredo Rosado (July 2nd, 2010)
 
Old July 2nd, 2010, 09:07 PM
Authorized User
 
Join Date: Dec 2009
Posts: 63
Thanks: 18
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Wilfredo Rosado
Default

Thanks Pegasus40218,

As soon as I typed your version the pictures came right up.

I was thinking along the same lines, but my syntax was not right and therefore the reason the pictures didn't show.

I tried:

<%# Eval("Path" + "Filename") %>

and

<%# Eval("Path") %> + <%# Eval("Filename") %>

Close but no cigar, eh!

Thanks again,
Fred





Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Display problem ratheesh_param ASP.NET 1.0 and 1.1 Professional 2 November 27th, 2006 01:02 AM
Image Display Problem ratheesh_param ASP.NET 2.0 Professional 0 November 22nd, 2006 03:24 AM
image display problem please help mateenmohd Classic ASP Basics 0 June 7th, 2003 02:00 PM
image display problem please help mateenmohd Classic ASP Databases 2 June 7th, 2003 01:07 PM





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