Ministerial “code”?

How come a Minister can’t talk about his constituency in Parliament but CAN say which side he supports in a referendum that will affect his all his constituents for decades to come?