Adding double quotes in <a> using C#
- by Solution
Hi Guys,
I have below code behind in c#
<a onclick='pageTracker._trackEvent('dictionary', 'spanish');' target ='_blank' href=" + Session["cmpDictionaryTitle"] + ">" + GetResourceString("c_DictionaryPDFName") + "</a>
I am trying to make below <a> link as shown below:
<a target ="_blank" href="/spa/Images/Diccionario_tcm25-18044.pdf" onclick="pageTracker._trackEvent('dictionary', 'spanish');">Diccionario de Español-Inglés GRATIS</a>
However my c# code is generating below output when html page get renders, the reason is that I am not able to put proper quotes in my code behind.
<a );="" spanish="" ,="" dictionary="" onclick="pageTracker._trackEvent(" href="/spa/Images/Diccionario_tcm25-18044.pdf" target="_blank">Diccionario de Español-Inglés GRATIS</a>
Can you please suggest how can I achieve above result in code behind.
Thanks & Best Regards