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

How can i pass string from one visualforc page to another without using controller

I need to pass 'BenefitsTab' string from vfp1 to vfp2 when i click command button in vfp1 which calls vfp2 into iframe. Plz help.This avoids me to write 11 VFP's
VFP 1:
<apex:page controller="BenefitsTabControllernew" access="global" id="benecomp">
    <apex:iframe src="/{!BenefitsTab.Default_Article__c}&isdtp=vw" id="mainframe" rendered="{!Benefitsframeflag}" scrolling="true" />
    <apex:commandButton value="Search Articles" onclick="document.getElementById('mainframe').src='/apex/Article_ResultsList';return false" id="submitButton" rerender="benefitspanel"/>
  <!-- I Need To pass 'BenefitsTab' string from this page to another VFP2-->

VFP 2:
<apex:page sidebar="false" title="Article List" controller="BenefitsTabControllernew" standardStylesheets="false" showHeader="false" >
<knowledge:articleList articleVar="article" pageNumber="{!currentPageNumber}" categories="{!BenefitsTab.Search_Category__c}" Keyword="{!searchstring}" hasMoreVar="false" pageSize="10">
Ravikant Saini 1Ravikant Saini 1
I think you can set parameters in url in first page by controller and get them in next page from url.
//for set value
public Pagereference goTo()
   Pagereference pref = Page.NextPage;;
   return pref;

//for get value in next controller
String value = Apexpages.currentPage().getParameters().get('name');

How about using <apex:param> in VFP1 to assign string to a method in controller.
get the string in VFP2 from the same controller. does this works?