473,507 Members | 13,917 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataList ImageUrl Syntax

I am using Visual Studio 2005.

I have the following code in my DataList:

<asp:Image ID="Image1" runat="server" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "PIN") %' />

This brings up the following graphic: http://localhost/PhysicianDirectory/017871

How can I write the ImageURL so that the result would be:
http://localhost/PhysicianDirectory/images/017871.jpg

Apr 11 '07 #1
1 2582
Have you tried something like:

<asp:Image ID="Image1" runat="server" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "PIN") %>.jpg' />

If that doesn't work, you can actually make it into a method:
<asp:Image ID="Image1" runat="server" ImageUrl='<%# AddSuffix(
DataBinder.Eval(Container.DataItem, "PIN") ) %' />

protected string AddSuffix(object urlPart)
{
return (string)urlPart +".jpg";
}

Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"sc***@metrohealth.org" wrote:
I am using Visual Studio 2005.

I have the following code in my DataList:

<asp:Image ID="Image1" runat="server" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "PIN") %' />

This brings up the following graphic: http://localhost/PhysicianDirectory/017871

How can I write the ImageURL so that the result would be:
http://localhost/PhysicianDirectory/images/017871.jpg

Apr 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1853
by: Stanley J Mroczek | last post by:
When I click in a picture, I get a error the changePicture is undefined <tr> <td colSpan="2"><asp:datalist id="Picturelist" runat="server" RepeatColumns="8"> <itemtemplate> <img ...
10
4128
by: David W. Simmonds | last post by:
I have a DataList control that has an Image control in the ItemTemplate. I would like to resize the image that goes into that control. I have a series of jpg files that are full size, full...
2
533
by: Vitalii | last post by:
Hi I am using Image control with DataList control but have a problem. Here is the code I am using <asp:Image ImageURL='<%# DataBinder.Eval(Container.DataItem, "imagefilename" ) %>'...
3
2769
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
6
2178
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
9
2707
by: Leon | last post by:
What Am I Doing Wrong? Code Will Not Run, I Can't See The Error! Thanks. <asp:datalist id="DataList1" runat="server" RepeatColumns="4"> <ItemTemplate> <asp:HyperLink id=HyperLink1 ImageUrl=...
1
4314
by: sck10 | last post by:
Hello, I have created a photo gallery of thumbnails using the code below. So far, I got the pictures to show, but now I need to figure out how a viewer can click on the thumbnail and it opens the...
3
3067
by: JuniorProgrammer | last post by:
Am trying to add an Image Button into a Datalist at Design time. When I run it it comes up with error: Server tag not well formed. It works perfectly when I add just an Image Control. Please...
2
1939
by: BengtPelle | last post by:
I have a page with two Datalists containing X number of ImageButtons. When the user clicks on an image in Datalist1 I need to copy the image to "Obverseimg" when the user clicks an image in...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.