The Windows Phone 7 SDK makes this very easy with the GetIsNetworkAvailable() method on the NetworkInterface class.
There are, however, two gotchas you need to be aware of when debugging.
1. If you call this method in code running in the emulator it will always return true.
2. If you call this method in code running on a tethered device (as you may have connected when debugging on a real device) it will always return true.
In both instances you'll need to code around the issue. (Or set break points and move the next/current executing line.)
You should also write code to handle the situation where a network connection is available but your specific web service/site isn't.
Hope this saves someone some head scratching.
If you've built Windows Phone or Windows Store apps you can cross-promote them with AdDuplex to get more users.