I'm using javascript to request a image generated by the server in real time.
The parameter is passed in the url and grabbed by MVC, and set in the "id" parameter to the controller. Like this:
Public Function Index(ByVal id As String) As ActionResult
This works fine if i dont use any special characters, like "?" or quotes. To send those I have to escape or encode this content, but how should i do it?
I tried javascript escape
or encodeURIComponent
, but it either gives me "bad request" or "Illegal characters in path"
A sample url would be http://localhost/Imagem/Index/Question%3F
, for "Question?"
This returns "Bad request"