Hi, this condition is known as micturition syncope. Usually the cause is not known. Also, no specific treatment is required.
Next Steps
Sit while passing urine
Sit on the edge of the bed before getting up for passing urine
Pass urine before going to bed
In case such event happens again, cross your legs and flex them.
Health Tips
Rarely a tumor in the bladder can cause such an event. Just for surety, please get an ultrasound kub region done.