ImageInDataList

G

gh

I am trying to add an image to my datalist. Below is the aspx code for
the datalist. When I run the app I get the following error:


"Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS1026: ) expected

Source Error:



Line 258: <asp:Label id="UserFieldLabel" runat="server"
width="450px" text='<%# Eval("UserField") %>'></asp:Label>&nbsp;Project:
Line 259: <asp:Label id="PrjNameLabel" runat="server"
width="253px" text='<%# Eval("PrjName") %>'></asp:Label>&nbsp;Project Date:
Line 260: <asp:Label id="ProjectDateLabel" runat="server"
text='<%# Eval("ProjectDate" {0:d}) %>'></asp:Label>Address:
Line 261: <asp:Label id="AddressLabel" runat="server"
width="250px" text='<%# Eval("Address") %>'></asp:Label><br>City:
Line 262: <asp:Label id="CityLabel" runat="server"
width="124px" text='<%# Eval("City") %>'></asp:Label>&nbsp;State:


Source File: c:\TCAPrjPhotoOnline\selprojects.aspx Line: 260 "

------------------------------------------------------------------------------------------------

DataList






<asp:DataList id="DataList1" runat="server" datasourceid="dsProjects"
datakeyfield="ExternalId" width="599px" cellspacing="6"
bordercolor="Black" cellpadding="6" borderwidth="2px"
gridlines="Horizontal" backcolor="LightBlue">
<EditItemStyle wrap="False" font-italic="False"
font-strikeout="False" font-underline="False" font-overline="False"
font-bold="False"></EditItemStyle>
<SelectedItemStyle wrap="False" font-italic="False"
font-strikeout="False" font-underline="False" font-overline="False"
font-bold="False"></SelectedItemStyle>
<ItemTemplate>
<p>
<asp:Image id="Image1" runat="server" width="25" alt="book
image" align="top" border="1" src='<%# Eval("PhotoPath",
"images/{0}.gif") %>'></asp:image>&nbsp;Company:
<asp:Label id="UserFieldLabel" runat="server"
width="450px" text='<%# Eval("UserField") %>'></asp:Label>&nbsp;Project:
<asp:Label id="PrjNameLabel" runat="server" width="253px"
text='<%# Eval("PrjName") %>'></asp:Label>&nbsp;Project Date:
<asp:Label id="ProjectDateLabel" runat="server" text='<%#
Eval("ProjectDate" {0:d}) %>'></asp:Label>Address:
<asp:Label id="AddressLabel" runat="server" width="250px"
text='<%# Eval("Address") %>'></asp:Label><br>City:
<asp:Label id="CityLabel" runat="server" width="124px"
text='<%# Eval("City") %>'></asp:Label>&nbsp;State:
<asp:Label id="StLabel" runat="server" width="108px"
text='<%# Eval("St") %>'></asp:Label>&nbsp;Posate Code:
<asp:Label id="PostalCodeLabel" runat="server" text='<%#
Eval("PostalCode") %>'></asp:Label><br>Country:
<asp:Label id="CountryLabel" runat="server" width="252px"
text='<%# Eval("Country") %>'></asp:Label><br>Description:
<asp:Label id="DescriptionLabel" runat="server"
width="440px" text='<%# Eval("Description") %>'></asp:Label>
</p> </ItemTemplate>
<AlternatingItemStyle wrap="False" font-italic="False"
font-strikeout="False" font-underline="False" font-overline="False"
font-bold="False"></AlternatingItemStyle>
<ItemStyle wrap="False" font-italic="False"
font-strikeout="False" font-underline="False" font-overline="False"
font-bold="False"></ItemStyle>
<SeparatorStyle backcolor="#00C0C0" borderstyle="Solid"
borderwidth="2px" bordercolor="Black" wrap="False" font-italic="False"
font-strikeout="False" font-underline="False" font-overline="False"
font-bold="False"></SeparatorStyle>
</asp:DataList></td>


It looks like the compiler is looking for a ")". What is missing or
incorrect with the code?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top