You can easily encode and decode string in c#. There is Microsoft library function that you can use to decode.
You can not directly pass everything in URL. Like url string only accepts ?, & and / . so you need to encode it before passing to the browser and after that you need to decode it to properly use.
Also if you will try to store raw url in database, It will prompt an error message. one way is to encode the given url and store it.
After encoding you need a url in original form. So use the following methods to decode url/string.
Sample encoding code is as follows:
- string result = System.Web.HttpUtility.HtmlDecode(Sample string);
- // other method
- Server.HtmlDecode(TestString)
0 comments:
Post a Comment