HTML encode not working properly for URL

1.5k views Asked by At

I am trying to generated a URL:

Get-it-Together-Stavros-Zenonos-amp;-Katerina-Ko?viewmode=0

Where you can see "amp;" after that url is not generating

Like below:

Get-it-Together-Stavros-Zenonos-amp

See my code below which is generating URL

<a class="fb-xfbml-parse-ignore" href="https://twitter.com/intent/tweet?url=<%=HTMLEncode(CMS.DocumentEngine.DocumentContext.CurrentDocument.AbsoluteURL)%>" onClick="return popup(this, 'notes')">  
 <img src="<%# Eval("twittericon") %>" alt="twitter icon" />
</a>

Could you help what i need to do to generate full URL?

1

There are 1 answers

0
Rory McCrossan On BEST ANSWER

The issue is because you're using HTMLEncode on the value in the URL. Instead you should use URLEncode.