Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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
  #1 (permalink)  
Old January 24th, 2008, 03:28 AM
Authorized User
 
Join Date: Jan 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default ImageUrl syntax

Hi,
I'm using a datalist and i have an image control in it.
I want the image Url to point to the pictures(.jpg)i saved under a folder named image based on a employee names from a database.
How do i do that?
Ex:i want my image URL to be C:\Website\Image\Bob.jpg
I roughly remember using a syntax somthing like this
ImageUrl='"~\Image"+<%# Eval("name")%>+".jpg"'
And it worked that time,but now when i try using it again,It just didn't work out as expected anymore.Please advice.Thanks

alvin

  #2 (permalink)  
Old January 24th, 2008, 03:31 AM
Authorized User
 
Join Date: Jan 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry,the syntax i used was this
ImageUrl='"~\Image\"+<%# Eval("name")%>+".jpg"'
Please advice

  #3 (permalink)  
Old January 24th, 2008, 03:47 AM
Authorized User
 
Join Date: Jan 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Solved the problem when i used this code:)
<%# Eval("LongID","~\Image\{0}.jpg") %>



Similar Threads
Thread Thread Starter Forum Replies Last Post
Eval ImageUrl doesn´t work studioc BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 May 23rd, 2008 05:57 AM
Databinding the ImageURL Prop of an Image Control Aaron Edwards ASP.NET 2.0 Professional 1 November 22nd, 2007 12:53 PM
help syntax please khautinh SQL Server 2000 1 August 26th, 2006 02:47 AM
c# syntax msrnivas .NET Web Services 2 October 15th, 2004 01:26 AM





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