I am having a problem with the resolution of an asterisk (*) in the URL of my website. I am running ASP.NET MVC 2 and .NET 4.0.
Here is an example that describes the problem:
http://mysite.com/profile/view/Nice *
The username is Nice *, and ASP.NET says the URL contains invalid characters:
Illegal characters in path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Illegal characters in path.
I tried all the methods of Web.config that I saw on the Internet, for example:
<pages validateRequest="false">
and
<httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" />
So my question is: is it possible to allow an asterisk in the url? If not, is there any coding method in .NET that can encode an asterisk (*)?
Thank!
source
share