It is narrated from Hazrat Abu Umamah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: Four types of people continue to receive reward even after their death: (1) The one who guards the Islamic borders in the way of Allah, (2) The one who performs a good deed whose effect continues, (3) The person who gives ongoing charity (sadaqah jariyah), (4) The person who leaves behind righteous children who pray for him.
Hadith Referenceمسند احمد / مسند الأنصار رضي الله عنهم / 22247
Hadith Gradingحکم دارالسلام:صحيح لغيره، وهذا إسناد ضعيف لضعف ابن لهيعة، وخالد بن أبى عمران لم يسمع من أبى أمامة، وقوله: ومن عمل عملا....ما عملخطأ، صوابه: ورجل علم علما، فأجره يجري عليه ما عمل به