Probably not the best way, but I've done it a few times. Doesn't recognize it right away sometimes, but that is why under the Display Preference Pane or the Display Menu Item, there is a feature called Detect Displays. Works fine and dandy after that.
So yes it is OK, but not advisable as MacDoc did say, it could fry something, but the likelihood is slim, but still there. If all else fails, just sleep the PB, attach the adapter and wake it back up. That should work a little better.
Pamela - It "could" be damaging. The chances are extremely slim, and I don't think there have been any reports that is has caused problems. Besides there are people who when their computers are on, unhook the monitor all the time. Haven't heard of any fried video cards or monitors. So I wouldn't worry about it. It is "safer" to plug it in when the computer is asleep or off however, but the technology has been made so that it won't fry, the signal, just stops at the connector, and doesn't go anywhere, like you turned off the monitor.
Not anything to really worry about. Unless you also worry about being struck by lightning, stung by killer bees or eaten by a rapid possum.