It was narrated that Abu Humaid As-Sa'idi said: "The Messenger of Allah P.B.U.H said: 'When anyone of you enters the Masjid, let him send peace upon the Prophet, then let him say: "Allahummaftah Ii abwaba rahmatika (0 Allah, open to me the gates of Your mercy)." And when he leaves, let him say: "Allahumma inni as'aluka min fadlika. (0 Allah, I ask of you from Your bounty)." (Sahih)