I am working on an ASP.NET MVC2 project. The problem is when a string which would be rewritten into URL contains a special character such as backslash or question mark, the URL will be wrong, even if I have encoded it before.
For example:
http://domain.com/Product/p001%5C2-2
responds HTTP Error 400 - Bad Request.How can I get it correct?
Try to use Html.Encode to resolve your backslash. If the backslash is the only 'special' character in your id, you could use Replace("%5C","\").
Have you checked your routingMap? there has to be a route like
Product/{prodictID}
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