[SalesForce] How to create a Lookup field in a Visualforce Page

I am developing a Visualforce Page and I want to render a lookup field in the same page.

So, I am attaching the page to my Custom Controller (Say AdminController) and I want to create a lookup field to User object.

I am new to salesforce, so any kind of help would be appreciated.

I have written my custom Controller

public class AdminController{
   public User usr {get;set;}

   // creating dummy method
   public String getUser() {
        return null;
    }

     public AdminController()
    {
       usr= new User();
    }
}

And in my Visualfolce Page I have entered

<apex:inputField value="{!usr.id}" /> 

Best Answer

public with sharing class AdminController {

  public AdminSetting__c adsetting { get; set; }

  public AdminController {    
    adsetting = new AdminSetting__c();  
  } 
}

The below is how your visualforce tag should be

   <apex:inputField value="{!adsetting.user_ref_field__c}" />

Please note i dont know your API names of object and field so you need to make sure to replace with exact names