Bound NavigateUrl issue

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

ASP.NET 2.0.....

In my DataList I have a hyperlink like this...

NavigateUrl='Shop.aspx?CategoryId=<%# Bind("CategoryId")%>'

This navigates incorrectly to here:

Shop.aspx?CategoryId=<%# Bind("CategoryId")%>

Any ideas how I can fix this?

Thanks!
 
I figured it out...

<ItemTemplate>
<asp:HyperLink id=hlLink runat="server" NavigateUrl='<%#
"Shop.aspx?CategoryId=" & Eval("CategoryId").ToString %>'
Font-Size="XX-Small" Font-Bold="True" ForeColor="RoyalBlue" Text='<%#
Eval("CategoryName", "{0}") %>'></asp:HyperLink>
</ItemTemplate>

Hope this is helpful to someone....

Thanks!
 

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

Back
Top