The castle is in Buda and the 'town' is in across the river in Pest hence the name Budapest