my dog's crate trained, so it's never been an issue... when he does go to the bathroom inside, it's always in the same place (well-lined with newspaper on a tiled floor).
if you're worried, just put the dog in a room where he can't get into much trouble but still has enough room to walk around and such, and close the door.