How to pass values between Visualforce page and Apex
Apex Class:
public class DemoController { public String name {get; set;} public String city {get; set;} public DemoController(){ name = 'Ranjith'; city = 'Chennai'; } }
Visualforce:
<apex:page controller="DemoController"> <apex:form > <apex:pageBlock > {!name} <br/> {!city} </apex:pageBlock> </apex:form> </apex:page>