Answer
Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- Because toilets were not clean in the past, the rule was to avoid mentioning the name of Allah in them out of respect and reverence.
2- If cleanliness of toilets is properly maintained and no traces of impurity are there, you can mention the name of Allah.
3- In this case, it is better to mention only the Dhikr related to the action you are doing (ablution, ghusl etc.)
In his response to the question, Dr. Muzammil H. Siddiqi, former President of the Islamic Society of North America states:
The toilet [or latrine] used to be a dirty place. One would see the filth around and it was a smelly place. It was not proper to take the name of Allah and make du`aa’ in such a place. Allah’s name is venerable and it must be respected.
Thus, the rule was that in such place the name of Allah should not be mentioned. Those who keep their toilets dirty and smelly should still abide by this rule.
But most people now keep their toilets very clean. If you keep your bathroom clean, then the rule will be that do not say the name of Allah when you are on the toilet seat. But when you finish from there and use the flush, then the area is for wudu’; and there you can mention any adhkar (mentions of Allah) of wudu that you wish to say.
The part above was excerpted, with slight modifications, from: http://pakistanlink.com
In addition, Dr. Rif`at Fawzi, professor of Shari`ah at Cairo University, adds:
As for making dhikr in the bathroom when you are making wudu or ghusl (ritual bath), it is permissible if you are sure that the place is pure and there is no impurity in it.
Also, this dhikr is to be confined to the du`aa’s (supplications) of the wudu or ghusl such as saying the Bismallah or seeking Allah’s refuge against Satan; otherwise it’s better not to make dhikr – which is meant to be an act of worship – in the bathroom.
Allah Almighty knows best.
Editor’s note: This fatwa is from Ask the Scholar’s archive and was originally published at an earlier date.