I need to pass the Query String of ID in which colon (:) is included i.e. ABC_PD:123456. When I am using this ID in query String session and when its redirect to another page in URL it give 404 no error found error on webpage.
So can any one provide the solution for this so that I can pass the colon in query string and when Page will be redirect without 404 error.
Solution would be much appreciated.
When you build the URL that you redirect to, you need to encode special characters by using the UrlEncode-method:
var redirectTo = "/mypage.aspx?id=" + HttpUtility.UrlEncode("id123:456");
This will create a query string that looks like this and will be interpreted correctly:
"/mypage.aspx?id=id123%3A456"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With