Allowing asterisk in URL - ASP.NET MVC 2 - .NET 4.0 or encoding
Posted
by
raRaRa
on Stack Overflow
See other posts from Stack Overflow
or by raRaRa
Published on 2010-12-31T00:03:38Z
Indexed on
2010/12/31
16:53 UTC
Read the original article
Hit count: 611
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!
© Stack Overflow or respective owner