How do I lock an .aspx form while processing?

How do I lock an .aspx form while processing?

Can the UI dialog be used for this?