Very often we have requirements to pass special characters (characters have a different meaning) in query string of the requested url, which may cause error unless they are properly encoded. These special characters can be handled by using the Hexadecimal Value of the characters instead of the characters themselves.
If a text(parameter) is “Content #1“, and we send this text as query string to insert this text to DB, then it inserts “Content” only and not “Content #1” . To avoid this situation we should replace “#” with its hexadecimal equivalent “%23” in Query String, and it will work fine. For further reference please visit –