Peter,
Is FormatURL specific to .NET 2.0? I get an error whenever I use it and
I'm still using VS 2003. Here is my datagrid code and the sproc that
I'm getting the data from :
<asp:datagrid id="dgFixtures" CellPadding="3" Width="304" Runat="server"
BackColor="#FFFFFF" forecolor="#000000"
ShowHeader="True" AutoGenerateColumns="False"
BorderColor="black" HeaderStyle-Font-Bold="true"
HeaderStyle-BackColor="#dcdcdc"
HeaderStyle-ForeColor="#00015E" Font-Size="8pt" Font-Name="arial"
BorderStyle="None" GridLines="None">
<Columns>
<asp:BoundColumn DataField="week" HeaderText="Week" />
<asp:TemplateColumn>
<ItemTemplate>
<asp:Image runat="server" ImageUrl='<%#
FormatURL(DataBinder.Eval(Container.DataItem, "image")) %>'>
</asp:Image>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="opponent"
HeaderText="Opponent"></asp:BoundColumn>
<asp:BoundColumn DataField="result" HeaderText="Result"
/>
</Columns>
</asp:datagrid>
CREATE procedure nflc_fixture_list_Test
@season varchar(50) ,
@team varchar(50)
As
Select [Week] As Week,
Case When HomeTeam = @team
Then upper(AwayTeam)
Else HomeTeam
End As Opponent,
Case When HomeTeam = @team
Then Convert(VarChar(20), IsNull(HomeScore, '')) + '-' +
Convert(VarChar(20), IsNull(AwayScore, ''))
Else Convert(VarChar(20), IsNull(AwayScore, '')) + '-' +
Convert(VarChar(20), IsNull(HomeScore, ''))
End As Result,
'/images/small/' + replace(Case When HomeTeam = @team Then
AwayTeam Else HomeTeam End, ' ', '') + '.gif' As Image
From nflc_fixtures
Where Season = @season
And (AwayTeam = @team Or HomeTeam = @team)
Order By [Week]
GO
Any idea what I'm doing wrong?