you can't use <%%> in < asp: tag attribute
you can try use html tag like < a >
and to do this .below is my example
<a href=<%# String.Format("'~/Phones/DisplayPhoneDetails.aspx?SelectedPhoneMacAddr={0}'", selectedCCMUserDetailled.primaryDevice.Value.ToString())%>><%= selectedCCMUserDetailled.primaryDevice.Value %></a>