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

D

Dave

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top