How to get values from apex:inputField in controller?

How to get values from apex:inputField in controller?

Visualforce page:

     <apex:page standardController=”Blog__c” extensions=”sample”>
        <apex:inputField value = “{!Blog__c.Name}”/>
        <apex:inputField value = “{!Blog__c.URL__c}”/>    
    </apex:page>

Apex Controller:

    Public Blog__c blg;
    public sample(ApexPages.StandardController controller)
    {

        this.blg = (Blog__c)controller.getRecord();
    }

Leave a Reply