function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ravindar AdminRavindar Admin 

“%20” changing to “+” when passing URL from visualforce page

I am passing URL from Visualforce page as below:

<div class="buttonbox"> <a href="{!communityPrefixe}/Web_LatestNews_LTG?tags=Glass%20School&thematicPage=1">{!$Label.HomePackagingGlass} </a> </div>

The URL should redirects as below:
https://vaqual1-verallia.cs86.force.com/Web_LatestNews_LTG?tags=Selective%20Line&thematicPage=1
But, In the URl "%20" replaced by "+" as below:
https://vaqual1-verallia.cs86.force.com/Web_LatestNews_LTG?tags=Selective**+**Line&thematicPage=1
Can anyone give suggestions on this, Thanks.
Raj VakatiRaj Vakati
Use HTMLENCODE as shown below 

    <div class="buttonbox"> <a href="https://tat--aaaaaaaa--c.cs91.visual.force.com/home/home.jsp?tags={!HTMLENCODE('Selective**+**Line')}&thematicPage=1">Click </a> </div>


https://developer.salesforce.com/page/Secure_Coding_Cross_Site_Scripting
Ravindar AdminRavindar Admin

Hi Raj,

I modified the link as below. but not working.

                        <div class="buttonbox"><a href="{!communityPrefixe}/Web_LatestNews_LTG?tags={!HTMLENCODE('Selective%20Line')}&thematicPage=1">{!$Label.HomeLearnMore}</a></div>
Narender Singh(Nads)Narender Singh(Nads)
Hi Ravinder,

Try this:
<div class="buttonbox"><a href="{!communityPrefixe}/Web_LatestNews_LTG?tags={!HTMLENCODE('Selective Line')}&thematicPage=1">{!$Label.HomeLearnMore}</a></div>

Let me know if it helps
thanks
Ravindar AdminRavindar Admin
Hi All,

I tried as you suggested. But, I didn't get. Can anyone give other suggestions?
Narender Singh(Nads)Narender Singh(Nads)
Hey,
Try using this:
<div class="buttonbox"> <a href="{!HTMLENCODE(communityPrefixe/Web_LatestNews_LTG?tags=Glass School&thematicPage=1)}">{!$Label.HomePackagingGlass} </a> </div>

Let me know if it helps