Methods of forming, dissolving, and functionalizing an extracellular matrix gel on demand based on cross-linking, modification, and dissolution of hydrogels using transpeptidase (e.g. sortase) are disclosed. Also provided are hydrogels comprising one or more macromers crosslinked to a mixture of peptides, wherein all or a portion of the peptides in the mixture comprise a recognition motif cleavable by a transpeptidase (e.g., sortase).