A novel two-dimensional photonic crystal (PC) contained azobenzene crosslinked liquid-crystalline polymers (CLCPs) was fabricated by using the nanoimprinting technique. In accordance with the deformations induced by the photochemical reactions of these azobenzene CLCPs, on/off switch characteristics were observed by alternate irradiation with UV and visible light. A reflectance contrast of about 45% was realized under the excitation of 20 mW/cm2 light intensity. And it exhibited a reversible switch behavior which indicated the high probability of the proliferation of numerous switching PC-based optical device applications.