This condition is called meralgia paraesthetica which manifests itself as
pain, tingling or burning sensation of
knee. It may occur due
to injury
to nerve either due to spinal deformity or along its path to thigh by any ligament or tendon stretch, excessive tight clothing (therefore it is also called "jeans disease"), diabetic neuropathy or damage to nerve after surgery etc. Another nerve which may cause pain in legs is sciatic nerve compression.