Hi Tanu,
The <apex:param> standard component allows parameters to be defined for a parent component, which can be assigned to a controller property.
VF Page:-
<apex:commandButton value=”Del” action=”{!delCont}” rerender=”all”>
<apex:param name=”contIdParam” value=”{!cont.id}” assignTo=”{!contIdChosen}”/>
</apex:commandButton>
Controller:-
public String contIdChosen {get; set;}
…
…
public PageReference delCont()
{
Contact toDel=new Contact(id=contIdChosen);
delete todel;
setupContacts();
return null;
}
Hope this will help you.
Thanks.