We consider a linear system with additive noise in Hilbert space and minimize a convex functional associated with this process. A necessary and sufficient condition for a control to be optimal is derived by evaluating the subdifferential of the cost function. Then the subdifferential of the value function is characterized. Finally using these results and a conditional value function, optimal controls are characterized as a feedback law in terms of the value function.