Two-photon dyes containing heterocyclic rings with enhanced photostability.