I built my current layout with extruded (pink) foam on top of plywood. I then glued O-gauge cork to the foam using yellow carpenter's glue and used Atlas track screws to secure the track into the cork and foam. This has kept the track firmly in position and the screws remain removable if necessary to replace a piece of track.
MELGAR