Saturday, October 6, 2012

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

Sometimes you get the following exception when usually opening a page in web browser
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() +8884233
   System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +59



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

Solution:
1.Check the url properly.Find out if there is any invalid character that has been accidently set as a part of the url.In my case when i got this exception,i did enough of google and all that....when  checked the url and i found that "colon :"  was getting appended to the url at the end.
like this http://localhost/myapp/index.aspx:
It is not always the case with colon...somtimes there may be some other unwanted character...This was the case with my problem...
I removed the colon and the problem was fixed......................and closed all the windows from google search :)


OR
These link may also be helpful
http://www.cryer.co.uk/brian/mswinswdev/ms_vbnet_server_error_potentially_dangerous.htm

http://stackoverflow.com/questions/5967103/a-potentially-dangerous-request-path-value-was-detected-from-the-client











No comments: