ASP.NET 4.0 Route expression builder inside Listview control
- by Carlos Lone
One of the features of ASP.NET 4.0 is Route Expression builder which allows you to set up hyperlinks like this:
<asp:HyperLink
runat="server"
NavigateUrl="<%$ RouteUrl:RouteName=productos,categoria=Cereales,id=2 %>" >Productos</asp:HyperLink>
Now I'm wondering if I can use this sort of syntax inside a ListView Control, I know is possible, but the tricky thing is that I want to genereate de route key value dynamically.
So instead to write id=2 I would like to write id=<%# Eval("CategoryID") % .
Can I do that?, if so, how should I write it.
Thanks for your help!