-2

My project is being developed in Mvc3. This questions is asked on numerous occassions and many blogs are also there for this issue. But I couldnt find satisfying solution and still giving me error "A potentially dangerous Request.Path value was detected from the client (>)." on my hosted solution.

My web.config file

<httpRuntime requestValidationMode="2.0"/>
    <pages validateRequest="false">
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="Telerik.Web.Mvc.UI" />
      </namespaces>
    </pages>

I have also stated ValidateInput[(False)] to corrosponding action

[ValidateInput(false)]
public ActionResult Category(int storeid, string storename,int categoryId)
        {
        }
Nitin Varpe
  • 10,450
  • 6
  • 36
  • 60

2 Answers2

2

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

error you are getting because of security issues just write this in config file:

<system.web>
<httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" />
<pages validateRequest="false" />
</system.web>
Kartikeya Khosla
  • 18,743
  • 8
  • 43
  • 69
1

You seem to be missing requestPathInvalidCharacters="" from the following

<httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" />

Either way, you may want to look at Encoding the URL, > would be %3C, this would prevent any security risks.

Christian Phillips
  • 18,399
  • 8
  • 53
  • 82