Re: Binding Hyperlink.NavigateUrl declaratively



Hi Dmitry,

I've done some test and both of following approaches should work for you:


<asp:HyperLink ID="link1" runat="server" Text="Link" NavigateUrl='<%#
String.Format("~/Carrier/AddNew.aspx?id={0}", Eval("Id"))
%>'></asp:HyperLink>
<br />
<asp:HyperLink ID="link2" runat="server" Text="Link2" NavigateUrl='<%#
String.Format("~/Carrier/AddNew.aspx?id={0}", FormView1.DataKey.Value)
%>'></asp:HyperLink>



The first one is assuming you need to use some field as the id; the second
one is the exact case as yours.

Please feel free to let me know if there's anything I can help.


Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


.



Relevant Pages