The two-dimensional (2D) metal-organic framework (MOF) [Cd(TPTZ)(H2O)2(HCOOH)(IPA)2]n (1; TPTZ = {4-[4-(1H-1,2,4-triazol-1-yl)phenyl]phenyl}-1H-1,2,4-triazole, IPA = isophthalic acid) has been constructed with the π-electron-rich aromatic ligand TPTZ, auxiliary ligand IPA, and the metal Cd(2+) ion with a d(10) configuration under solvothermal conditions. Complex 1 exhibits a strong ligand-originated photoluminescence emission, which is selectively sensitive toward electron-deficient nitroaromatic compounds, such as nitrobenzene (NB), 1,3-dinitrobenzene (m-DNB), and 1,4-dinitrobenzene (p-DNB), and nitro-aliphatic compounds, such as nitromethane (NM) and tris(hydroxymethyl)nitromethane. This property makes complex 1 a potential fluorescence sensor for these chemicals. Single-crystal X-ray diffraction studies revealed that dinuclear cadmium building units were further bridged by TPTZ ligands to give a four-connected uninodal net with the Schläfli symbol of [4.6(3).4.6(3).6(2).6(4)].