databinding to a hyperlink control.
I have:
VB Code:
<asp:HyperLink id="lnkEdit" ImageUrl="/Resource/Edit.gif" NavigateUrl='<%# DataBinder.Eval(container.DataItem, "DivisionKey") %>' runat="server">
</asp:HyperLink>
Which is good.
When I hover my mouse over it show's this correctly.
However, for the navigate URL I would like:
VB Code:
NavigateUrl='Woof.aspx?Moose=<%# DataBinder.Eval(container.DataItem, "DivisionKey") %>'
BUT when I add the Woof.aspx text then the hyperlink no longer displays the value from my dataset, but in fact actually shows the "<%# DataBinder..." in my link.
Any ideas?
Woof
Re: databinding to a hyperlink control.
Done it.
Code:
<asp:HyperLink id="lnkEdit" ImageUrl="/Resource/Edit.gif" NavigateUrl='<%# "AFREdit.aspx?DivisionKey=" & DataBinder.Eval(Container.DataItem,"DivisionKey") & "&OperatingUnitKey=" & DataBinder.Eval(Container.DataItem,"OperatingUnitKey")%>' runat="server">
</asp:HyperLink>
Woof