I am trying to retrive a list of fixtures from my extended Clubsite DB (successfully), but I'd like to make one of the retrieved fields a Hyperlink to another page, passing a related parameter. My code is at the bottom of this post, but I get the following
error:
The name 'Cstr' does not exist in the current context
Can someone explain to me why I cannot use Cstr in this context? I have used the code which is used in the PhotoAlbum and List pages, so thought it should work... what am I doing wrong??
changeofhart
Member
50 Points
10 Posts
The name 'Cstr' does not exist in the current context
Jan 30, 2006 09:07 AM|LINK
I am trying to retrive a list of fixtures from my extended Clubsite DB (successfully), but I'd like to make one of the retrieved fields a Hyperlink to another page, passing a related parameter. My code is at the bottom of this post, but I get the following error:
The name 'Cstr' does not exist in the current context
Can someone explain to me why I cannot use Cstr in this context? I have used the code which is used in the PhotoAlbum and List pages, so thought it should work... what am I doing wrong??
<
asp:DataList ID="DataList1" runat="server" DataKeyField="FixtureID" DataSourceID="SqlDataSource1" Width=100% Font-Size="Smaller" Height="53px"><ItemTemplate>
<table width="100%" border="0" cellpadding=0 cellspacing=0> <tr> <td width="10%" align="center"><asp:Label ID="fixturedateLabel" runat="server" Text='<%# Eval("fixturedate") %>'></asp:Label></td> <td width="40%" align="left"><div><a href='<%# "Results.aspx?FixtureID=" & Cstr ( Eval("FixtureID"))%>'> <asp:Label ID="FixtureOppositionLabel" runat="server" Font-Bold="True" Text='<%# Eval("FixtureOpposition") %>'></asp:Label></a> </div></td><td>.....</td>
</tr> </table> </ItemTemplate> Thanks!changeofhart
changeofhart
Member
50 Points
10 Posts
Re: The name 'Cstr' does not exist in the current context
Feb 07, 2006 10:49 AM|LINK
in case anyone is viewing this and wanting to know the correct answer, I eventually found it in another post.
change CStr to Convert.String and it works fine.
happy coding.