A potentially dangerous Request.Path value was detected from the client (&).

Ajay
Ajay
46 Points
3 Posts

I'm using .net 4.7. Showing errow when passing special characters in the url and getting following error:

A potentially dangerous Request.Path value was detected from the client (&).","Data":null,"InnerException":null

Is there anyway to resolve it?

Views: 457
Total Answered: 3
Total Marked As Answer: 1
Posted On: 16-Apr-2024 06:19

Share:   fb twitter linkedin
Answers
Smith
Smith
2890 Points
78 Posts
         

Add following in the System.Web in the web.config:

<system.web>
  <httpRuntime requestPathInvalidCharacters="" />
   -----
</system.web>

It will allow all characters in the request path.

Posted On: 16-Apr-2024 06:52
thanks.
 - Ajay  16-Apr-2024 23:14
Good catch!
 - Rashmi  17-Apr-2024 03:43
Ajay
Ajay
46 Points
3 Posts
         

Thanks. Worked as charm!

Posted On: 16-Apr-2024 23:14
Rashmi
Rashmi
1068 Points
19 Posts
         

I saved my time and my issue was resolved too.

Posted On: 17-Apr-2024 03:44
 Log In to Chat