Sample Code:
Visualforce page:<apex:page standardcontroller=”account” extensions=”Sample”>
{!Aid}
</apex:page>
Visualforce page:<apex:page standardcontroller=”account” extensions=”Sample”>
{!Aid}
</apex:page>
Apex Controller:
public class Sample {
public Id Aid {get;set;}
public Sample(ApexPages.StandardController controller) {
Account acc = new Account();
Aid = controller.getId();
}
}
Output in Account Page layout: