Screen gets stuck, blank when monitor get off.

Kindly advise.

I am accessing my PC from my laptop through teamviewer. It goes fine but when I switch off the monitor screen. It gets stuck, hang and sometimes black screen appears.