Url Encoded Asterisk

If I pass the string as a parameter to Url.Encode, .NET decides not to url encode.

So...

Url.Action("A", "C", new { id = "1*1" }

      

... will create url http: // mysite / C / A / 1 * 1

However, when this link is clicked .NET rejects the parameter and throws an exception ...

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

      

If I change the url (in chrome) to the url-encoded version ...

http://mysite/C/A/1%2A1

      

... if it still throws the same error?

How can I ensure that URLs generated by .NET on one page are resolved on another page?

+3
c # .net


source to share


No one has answered this question yet

See similar questions:

206
Potentially dangerous Request.Path value was found on the client (*)

or similar:

2058
How do I get a consistent byte representation of strings in C # without manually specifying the encoding?
1168
Path.Combine for URLs?
206
Potentially dangerous Request.Path value was found on the client (*)
sixteen
error when url resource contains ampersand
2
Error: Potentially Bad Request. how can a url containing (&) be resolved
1
Passing URL-encoded URLs as parameters to controllers
1
Using colon in url
0
An unhandled exception has occurred
0
URL parameter (& cfs = 1) Throwing .NET exceptions
0
Handling an ampersand in a URL



All Articles
Loading...
X
Show
Funny
Dev
Pics