I'm using the following Visualforce code to send multiple parameters (including a returl) to a controller.

<apex:outputLink target="_blank"  styleClass="btn addToBtn2" 
New Scholar Request

When I try to get the result in the controller constructor, I get:

tmp =  apexpages.currentpage().getparameters().get('siteID');

I get this result:


That's the whole set of parameters, not just the first one. Why don't they get split up? Do I need to individually URLENCODE each parameter after the first?

  • 2
    I see 2 '?' try /apex/NewScholarRequest?SiteID={!selectedProgram}&returl=/apex/be1_Attendance....... Ideally I would use <apex:param> to pass parameters to the controller than this URL hack way, but thats your choice
    – Rao
    Feb 17, 2016 at 22:46
  • I may well give the <apex:param> method a try. It certainly looks clearer than what I came up with.
    – Jagular
    Feb 18, 2016 at 4:35

1 Answer 1


The URLENCODE call will encode the ? and & delimiters whereas you really need to just encode each parameter.

One way to do that is:

  • Nice catch @KeithC!
    – Adrian Larson
    Feb 18, 2016 at 2:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .