Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML encode not working properly for URL

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?

like image 930
SmartestVEGA Avatar asked Oct 29 '22 14:10

SmartestVEGA


1 Answers

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

like image 60
Rory McCrossan Avatar answered Nov 14 '22 19:11

Rory McCrossan