I have a keyboard that became very dirty with the years. Its (originally) white color and clear case made the dirt very apparent.
So I wanted to give the dishwasher a try, and without taking each key apart -- patience has its limits!
It worked great for me, and just requires some caution.
If possible, take the case apart. This will help the dirt, then the water, go away.
Allow to dry completely. It will take days. Failing to do it may cause shorts and harm your keyboard and your computer!
Wash at mild temperature.
These instructions have details for an old Mac keyboard, but the principle is not limited to this model.
In any case, please use your common sense; do it at your own risk; in case of doubt, don't do it. (Well, you're on instructables.com)