Most employers don't ask, and the few that have (perhaps by having a part of an employment form ask for previous salary) have never made my leaving that information out an issue.
Most recruiters, if they even ask, respect my decision not to talk about it, but I've been pressed hard on this by a handful of recruiters, and have had this be a deal breaker for a couple of them. One recruiting firm admitted that they were paid by the employers to get this information. I wasn't getting paid to give this information out, however, and it's worth more to me to keep it private as I'm placed at a disadvantage in negotiations if I name a number first.
It's still a seller's market for IT talent, and there are plenty of other fish in the sea, so if some recruiters can't accept that I won't name a number, it's their loss.
It's great that NYC is taking the lead on this, and I really hope the rest of the US follows suit.