I'm trying to bind an ID to an already defined navigation url from a hyperlink.
<asp:HyperLink ID="HyperLink4" runat="server"
NavigateUrl='accounts_history.aspx?accountId=<%# DataBinder.Eval(Container.DataItem, "Id") %>'>Historiek</asp:HyperLink>
This is my hyperlink. The <%# DataBinder.Eval(Container.DataItem, "Id") %>
part works but using this method the hyperlink just sees it as clear text, resulting in the following link:
accounts_history.aspx?accountId=<%# DataBinder.Eval(Container.DataItem, "Id") %>
What is causing this?
Try this
http://msdn.microsoft.com/en-us/library/2d76z3ck.aspx
You should place only databinding expression in property.