In this paper a general class of convex parabolic control problems with control appearing in the region or on the boundary is considered. Restrictions on the control as well as on the state are admitted. Necessary and sufficient conditions for optimality and a duality theorem will be derived.