I have a controller in an MVC 4.NET application that receives a string as a parameter from a URL. This comes from an aspx page redirected to the controller in Route.config.
If I send this value for the parameter in the client: fwdgerhb+bhrth+ftrgbhrt
I get the following value on the server: fwdgerhb bhrth ftrgbhrt
The server interprets the URL parameter value as an encoded URL and replaces +with . But it was not URL encoded. This will happen for other combinations of special characters if they appear in the parameter value.
Does IIS Server have a configuration parameter to configure the server so as not to try to convert this value to a URL?
Request example:
mypage.aspx?value=cat+dog (NOT ENCODED)
Route configuration
static void RegisterRoutes(RouteCollection routes)
{
routes.MapRouteLowercase(
name: "MyRouter",
url: "mypage.aspx",
defaults: new { controller = "My", action = "DoLog" }
);
}
Controller:
public class MyController : Controller
{
[AllowAnonymous]
public ActionResult DoLog(string value)
{
}
}