Error : potentially dangerous Request. how can able to allow the url containing a (&)

asp.net, c#

Solution

The ampersand (`&`) has special meaning in a URL, being used to separate elements within Query String and Fragment parts. This usage is forbidden by default because it's typical for hackers to probe around like this, trying to discover exploits.

To avoid this you need to use URL encoding on the path, so the ampersand is encoded to `%26`, making the final URL:

http://localhost:4566/PropertyMap/project/ackruti-gardenia-dahisar-%26-beyond-mumbai

Since you do not specify where the URL is constructed I cannot help you with how to encode it properly - implementation differs per language.

Problem

this is my the url- ``` http://localhost:4566/PropertyMap/project/ackruti-gardenia-dahisar-&-beyond-mumbai ``` and I got error as- 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.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (&). Stack Trace: ``` [HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (&).] System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9673044 System.Web.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +35 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 ``` How can i solve it?

Original source

Related problems