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> Project:
Line 259: <asp:Label id="PrjNameLabel" runat="server"
width="253px" text='<%# Eval("PrjName") %>'></asp:Label> 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> State:
Source File: c:\TCAPrjPhotoOnline\selprojects.aspx Line: 260 "
------------------------------------------------------------------------------------------------
DataList
<aspataList 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> Company:
<asp:Label id="UserFieldLabel" runat="server"
width="450px" text='<%# Eval("UserField") %>'></asp:Label> Project:
<asp:Label id="PrjNameLabel" runat="server" width="253px"
text='<%# Eval("PrjName") %>'></asp:Label> 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> State:
<asp:Label id="StLabel" runat="server" width="108px"
text='<%# Eval("St") %>'></asp:Label> 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>
</aspataList></td>
It looks like the compiler is looking for a ")". What is missing or
incorrect with the code?
TIA
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> Project:
Line 259: <asp:Label id="PrjNameLabel" runat="server"
width="253px" text='<%# Eval("PrjName") %>'></asp:Label> 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> State:
Source File: c:\TCAPrjPhotoOnline\selprojects.aspx Line: 260 "
------------------------------------------------------------------------------------------------
DataList
<aspataList 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> Company:
<asp:Label id="UserFieldLabel" runat="server"
width="450px" text='<%# Eval("UserField") %>'></asp:Label> Project:
<asp:Label id="PrjNameLabel" runat="server" width="253px"
text='<%# Eval("PrjName") %>'></asp:Label> 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> State:
<asp:Label id="StLabel" runat="server" width="108px"
text='<%# Eval("St") %>'></asp:Label> 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>
</aspataList></td>
It looks like the compiler is looking for a ")". What is missing or
incorrect with the code?
TIA