I have looked to all the similar questions but is still not able to get it to work:
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# String.Format("~/Phones/DisplayPhoneDetails.aspx?SelectedPhoneMacAddr={0}", selectedCCMUserDetailled.primaryDevice.Value.ToString())%>'><%= selectedCCMUserDetailled.primaryDevice.Value %></asp:HyperLink>
This generates:
<a id="MainContent_HyperLink2">CSFD4SIG</a>
Thanks for your help.