1
I’m trying to submit an action with a parameter like this:
<a href="@Url.Action(@"Create/?reference=01/04/2016", "Cobranca")"
But it generates a URL like this:
Cobranca/Create/%3freference%3d01/04/2016
And causes the mistake:
A potentially dangerous Request.Path value was detected from the client
I put on the web.config the following codes:
<pages validateRequest="false" />
<httpRuntime targetFramework="4.5" requestPathInvalidCharacters="" />
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true"/>
</security>
Stopped this error but now from 404 error being that the URL should be:
Cobranca/Create/?reference%3d01/04/2016
or better
Cobranca/Create/?reference=01/04/2016
in fact my action receives 3 parameters, how to send in this case?
– Dorathoto
The same way you did with the Reset, adding the extra parameters in the dynamical object
<a href="@Url.Action("Create", "Cobranca", new { reference = "01/04/2016", parametro2 = 2, andHisNameIs = "JOHNCEEENA"}) "/>
. Remembering that you are not required to pass all parameters of yourAction
, unless they are very important to your logic. Parameters that are not passed will only receive the valuenull
.– Thiago Ferreira