how to make Hyperlink control works on code-behind file in asp.net?

Zhao

New member
I have asp hyperlink in my aspx page like following:

<asp:HyperLink ID="HyperLink1" runat="server" Text='DOWNLOAD THE PDF' navigateUrl='<%# "~/product.aspx?id=" & Databinder.Eval(Container.DataItem, "id")%>' />

I need to move navigateUrl to code-behind file because I need pass one more parameter from cookie to this navigateUrl,I cannot use dynamic cookie value in aspx file, so I have to move this part to code-behind file then write something like: this.HyperLink1.navigateUrl = "~/product.aspx?para1=" & cookieValue & "&id=" & Databinder.Eval(Container.DataItem, "id")

my problem is how to make id=" & Databinder.Eval(Container.DataItem, "id") part works on codebehind file?

Thanks for your help
 
Back
Top