In this paper, an inhomogeneous heat equation with distributed load is controlled, on the basis of an infinite dimensional generalization of sliding-mode control method. The control law is designed so that: (i) the temperature can track a desired reference signal, and (ii) the temperature can remain in a constrained region. We show that, with the designed control, the tracking error is bounded stable without violation of the constraint. The stability is proved under the designed control law. Numerical simulations are given to illustrate the effectiveness of the designed control law.