A potentially dangerous Request.Path value was detected from the client (&).
Hi,
I have migrated some blog data using sitefinty native api. now I am seeing a error on my system
A potentially dangerous Request.Path value was detected from the client (&).
Full screenshot is attached below . I have tried solution provided over net using
www.sitefinity.com/.../mvc-url-with-query-string-fails-if-the-query-string-ends-in-a-period
<httpRuntime relaxedUrlToFileSystemMapping="true" />
like adding httpRuntime exceptions for characters. But nothing worked in my case. rather I am getting 500 error when I add these to my web.config file.
Please provide me a solution if I can fix them without changing records.
Server Error in '/' Application.
A potentially dangerous Request.Path value was detected from the client (&).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 (&).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (&).]
System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +12353311
System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +166
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274
Thank You
Chandresh
Hi Chandresh,
Usually this exception is thrown when the URL indeed contains a dangerous character like a "*", "&". The error just shows that an url encode is not called somewhere where it should be. In this case the invalid character on your side is (&).
If you have created the blog posts using the API, please note to construct properly the url and replace the special characters in it.
You can check the below article for more details about the creating blog posts where you can see a sample on how to construct the url:
http://docs.sitefinity.com/for-developers-create-blog-posts
Regards,
Sabrie Nedzhip
Telerik