I'm having a trouble allowing asterisk (*) in the URL of my website. I am running ASP.NET MVC 2 and .NET 4.0.
Here's an example that describes the problem:
http://mysite.com/profile/view/Nice*
The username is Nice* and ASP.NET says there are illegal characters in the URL:
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 have tried all the Web.config methods I've seen online such as:
<pages validateRequest="false">
and
<httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" />
So my question is: Is it possible to allow asterisk in URL? If not, is there some encoding method in .NET that can encode asterisk(*) ?
Thanks!
http://www.w3.org/Addressing/URL/4_URI_Recommentations.html
Other reserved characters
The asterisk ("*", ASCII 2A hex) and exclamation mark ("!" , ASCII 21 hex) are reserved for use as having special signifiance within specific schemes.
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