Save your string "key" value in a publicly declared variable in your server side event, then access it in your aspx code.
public string myKey = string.Empty;
then in your aspx code
<![CDATA[<% if (myKey == "50")
{
%>]]>
<a id="A1" href="http://www.google.com" target="_blank">test link</a>
<%}
else
{
%>
<a id="A2"></a>
<%}%>