Hi,
I am trying to pass a parameter string from one page to another. This string may contain all sorts of characters ( ie whateever may be in an encrypted string such as "+" and "=" etc etc )
I am using Request.QueryString to obtain the value - even though I am using HttpUtility.Encode and Decode, it seems that it does not preserve the "+" sign - so therefore I replace the plus sign in the original string with some unique string then after it is decoded the string has the plus signs put back in by replacing the unique string.
This works for me.
My question is:
Do I have to worry about any other characters that could be a problem that HttpUtility.Encode does not handle but have some special meaning besides the plus sign?
Thanks
-Barb
Hi,
did you already try out theUrlEncode and UrlDecode methods? These helped me out in the recent past when I had to pass the # sign in the querystring and HtmlDecode / HtmlEncode didn't really help me out. Just my 2 cents.
Grz, Kris.
Thanks for your reply
You are right Html/Encode Decode actually does not really do what I want - it may change some special characters to another representation but they are still interpreted as special characters - The ones that seem to be a problem are + " : < > # and & For these, I replace them each with a special unique string then in the receiving page replace them back to what they should be. After testing , passing all characters on the keyboard, I only seem to have a problem with these - Do you know of anything else that could be a potential problem?
thanks
Barb
Hi,
instead of creating your own code for this you could also try out the UrlEncode and UrlDecode. It really helped me out when I had problems with certain characters in the querystring. Just take 5 - 10 minutes to set up a little sample application and experiment with it.
Grz, Kris.
No comments:
Post a Comment