0

I don't understand why I am getting exception calling the action from my controller by typing the full url

It works fine calling from form or ajax post using jquery, it is not setup to accept only post, my last try, I just specify explicitly the HttpGet and setip the validation page = false in the web.config. I'm lost

this is the url I am passing: main/request/theprogram=xx&theaction=yyy&theobject=

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

4

1 回答 1

1

&作为 Uri 的“路径”部分的一部分传递,这是非常不寻常的并触发警告。

您很可能希望它成为“查询”部分的一部分(*注意?分隔查询部分):

main/request/?theprogram=xx&theaction=yyy&theobject=

如果您希望参数成为路径的一部分,那么通常没有名称,而只是定位值或使用路径安全分隔符,例如()

main/request/xx/yyy/
main/request/theprogram(xx)/theaction(yyy)/theobject()
于 2013-06-15T18:32:25.350 回答