A one-step synthesis strategy based on aza-Michael reaction of poly(ethylene glycol) diacrylate (PEGDA) or PEGDA/1,6-hexanediol diacrylate (HDDA) mixture and cystamine was employed to fabricate injectable, biocompatible, and degradable novel poly(beta-amino ester) (PBAE) hydrogels. The gelation was monitored by real-time dynamic rheological measurements to follow the formation of PBAE hydrogel networks. The obtained hydrogels were responsive to both pH and redox state, which enabled the control of swelling, degradation, and release properties by external triggers. Degradation products of the hydrogels were shown to have no significant cytotoxicity on A549 adenocarcinomic human alveolar basal epithelial cells and MCF-7 human breast cancer cells. The hydrogels were loaded with a photosensitizer, methylene blue (MB), as a model compound by simple addition of the MB molecules into the precursor mixture. The activity of released MB was assessed by in vitro photodynamic therapy (PDT) studies conducted with A549 cells.