A swift punch in the nose as hard as you can usually will deter a dog from jumping up on you even when it is just playing.You can also control a dog if it is wearing a collar. Hold the collar under the neck, twist the collar and put downward pressure on the collar. Usually the dog will calm down and you can lead it anywhere. I have had to do that at customer's homes. Good thing, the homeowner never knows I am doing it and it keeps me safe. It doesn't hurt the dog, just controls it.
Keith