impossible to append a variable to a hyperlink, inside a template, inside a DataList?

Discussion in 'ASP .Net Web Controls' started by Dave, Aug 30, 2003.

  1. Dave

    Dave Guest

    Hi ,

    I have the following where I need to append a string variable inside a
    hyperlink
    template, inside a datalist. The variable 'categoryList' is the culprit.
    No matter where this variable is declared, the compiler says it is
    'undeclared'.
    It makes no sense that I can use literal strings but not variables
    containing strings!
    What am I missing here? I am a newbie to ASP.NET trying to rebuild my ASP
    library using VS 2003.


    <asp:datalist id="list" Height="8px" Width="250px" runat="server">
    <ItemTemplate>
    &nbsp;
    <asp:HyperLink id="HyperLink1" runat="server"
    CssClass="CategoryUnselected" NavigateUrl='<%# "../index.aspx?catID=" &
    categoryList & "|" & DataBinder.Eval(Container.DataItem, "CategoryID")%>'
    Text='<%# DataBinder.Eval(Container.DataItem, "CategoryName") %>'>

    </asp:HyperLink><br />
    </ItemTemplate>
    </asp:datalist>

    When this is run, I get the undeclared variable error - even putting a DIM
    categoryList
    statement at the top of the actual HTML page will not work!

    TIA,
    Dave
    Dave, Aug 30, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    786
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,849
  3. Replies:
    0
    Views:
    737
  4. HYRY
    Replies:
    10
    Views:
    587
    Bruno Desthuilliers
    Sep 26, 2007
  5. Replies:
    5
    Views:
    250
    Michele Dondi
    Jun 30, 2006
Loading...

Share This Page