It really depends on the problem. Knee pain is very vague. Let me help you narrow it down. Where on the knee is it hurting(front, side, back)? What kind of pain is it (dull, sharp, burning)? Is it a chronic pain or an acute pain? What movements cause you the most pain?
Depending on how you answer any one of these questions will lead to a different type of training, but in general non load bearing cardio would probably be best.
I suggest you have a thorough functional/mobility assessment done for your hip and ankle. Most problems that are not caused by direct trauma are related to issues/compensation patterns in the kinetic chain.