0

Hi I have Jquery & ASP.NET server side. I am looking for a way to safely post data from a client to the server and vise versa without worrying of special characters like ",'~ etc... Is JSON a better way?

Thanks

1 Answer 1

0

Whatever you choose will need to be encoded for transport. If you just put the data into the URL, you should URL encode the data, if you put in JSON, you still need to escape " if the data is in a string.

3
  • @oshafran: so far I know the only character you need to encode is the quote and you could do it like this \' (using the backslash) Oct 14, 2010 at 14:57
  • So just do replace ' to \' before sending? what about Decoding it in the C# side?
    – Himberjack
    Oct 14, 2010 at 14:59
  • If you use a JSON parser, the string should be decoded for you already. If you are writing a JSON parser, you need to do it.
    – Lou Franco
    Oct 14, 2010 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.