The name 'Cstr' does not exist in the current context RRS feed

  • Question

  • User1008851990 posted

    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">


    <table width="100%" border="0" cellpadding=0 cellspacing=0>


    <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>








    Monday, January 30, 2006 5:07 AM

All replies

  • User1008851990 posted

    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.

    Tuesday, February 7, 2006 6:49 AM