I kind of figure it's in how you ask and how you respond. If you ask politely, you're doing no harm. And if someone asks you, then you respond politely (whether you disclose the information or not).
I don't think it's wrong to ask someone that, but if you ask you should be prepared for someone to say "No, I'd rather not say" or in some cases even ignore you. It is their business, after all, and that should be the end of that. If someone badgers me repeatedly it's annoying and rude, but really, I'm not going to be bothered by someone asking me once what I paid for X, Y or Z.
And in forums, I think it's better to send someone a private message rather than ask in the actual thread, but even if they do, my thoughts on it are still pretty much the same. *shrugs*