I recently had about 3-4 guys consecutively do this while I was in Los Angeles (men are probably a lot more forward about these things over there), and I turned them down. Not because I'm stuck up, but they genuinely went about it in THE most creepiest way possible. And I get that they probably didn't mean for it to be that way, but when you're asking something as intrusive as that, you HAVE to get the delivery right to stand a chance.
One guy just stopped in the street, made a whistle sound or something crude, and straight up asked if I had a boyfriend and then without waiting for a response, asked to have my number. Another just followed me creeper-like for a good 5 minutes before awkwardly asking with this weird smile on his face (his attempt at easing the awkwardness, I guess). Didn't ask anything about me or explain himself, just outright asked for it. And the rest were similar..
You have to lead up to a question like that- introduce yourself and make it obvious that you're interested because she seems like a NICE PERSON, not just a hot body you want a one nighter with some time. Possibly it's best not to reference her appearance at all, even if you're just being sweet and not perverse about it, because it can easily give off the wrong signal. Try not to come across awkward, but then not too cocky either- it's a very fine line you're walking. I don't disagree with approaching women when you're genuinely interested in getting to know her and maybe date her; but men have to understand that a lot of us go through a lot of crap on a daily basis from less decent guys, so we're always cautious. Once we realise you're not being a weirdo about it, it's easier for us to open up a little.