In solid sodium chloride
ions are tightly held together and occupy fixed position. But in molten or solution form ions become free and move toward opposite electrodes. It is the reason solid does not conduct electricity but in molten or solution form NaCl conduct electricity.