I have a function that is called getUserID and I would like to pass the user ID via NavigateUrl within asp:HyperLink.
This is my hyperlink:
<asp:HyperLink ID="lnkMyAccount" Text="My Account"
NavigateUrl="~/Users/View.aspx" style="color:White" CssClass="myAreaLink"
Runat="server" Font-Size="Small" />
|
I tried this but it did not work:
<asp:HyperLink ID="lnkMyAccount" Text="My Account"
NavigateUrl='<%# "~/Users/View.aspx" + CPDManagement._code.SearchSelection.getUserID().Tables[0].Rows[0]["u_ID"].ToString() %> style="color:White" CssClass="myAreaLink"
Runat="server" Font-Size="Small" />
|
What about doing it in the code behind?
So it will just programmatically overwrite the navigation URL
Does that work for you?
You might be able to get the
<%# .. %>data binding syntax to work by calling data bind on the page i.e.I would do the first way though