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
Salesforce_ckumarSalesforce_ckumar site -- Redirect problem

when a search button on vf page is clicked, serch function in class makes request for facebook verification code and then redirectes page along with verification code...

visual force page tag contains action attribute which makes initialAction function to get executed, it checks whether URL contains verification code,, if yes, page gets redirected to URL specified in pagereference object but the URl gets appended with %23_=_


i am not able to find, why %23_=_ is getting appended to url....


vf page :

 <apex:page standardController="Event__c"  extensions="TEventSearch" action="{!initialAction}">

<apex:image value="{!$Resource.theme1_searchButton_jpg}" onclick="doSave()" />
 <script type="text/javascript">  
 function doSave()
 document.getElementById("{!$Component.hidVal}").value = strUid1;
<apex:actionFunction name="paraFunction" action="{!search}" status="statusSearch" /> 



Apex class code :

public class TEventSearch

public TEventSearch(ApexPages.StandardController controller)


public PageReference initialAction()
    PageReference p = null;
        p = new PageReference('');
        p.getParameters().put('res', 'fb');

    return p;

public PageReference search()

 AccessTokenAndkey__c fapp;
 fapp = [Select Id, UserName__c,intRedirect__c, Password__c, Name, Key__c, Extended_Permission__c, Code__c, ApplicationSecret__c, ApplicationId__c, AccessToken__c From AccessTokenAndkey__c where Name = :'Facebook'];
 String exPerms = '&scope=user_about_me,user_activities,user_birthday,user_events,user_likes,user_location,user_website,read_requests,read_stream,create_event,publish_stream,rsvp_event';
String rediruri = '';

String authuri = ''+fapp.ApplicationId__c+'&redirect_uri='+EncodingUtil.urlEncode(rediruri, 'UTF-8')+exPerms;
pgRef = new PageReference(authuri);
return pgRef;







Url encoding is taking place here.

%23 is encoding for sign #.


You can see all codes here: