I’m using ASP.NET MVC 3 and I would like to accept url as parameter for one of the action. But, I’m getting “HTTP Error 400 – Bad Request.” error for the below example. How do I resolve this issue?
Example:
http://localhost:8343/http://google.com
Global.asax.cs:
routes.MapRoute(
"Default", // Route name
"{hostUrl}", // URL with parameters
new { controller = "Home", action = "Index", hostUrl = UrlParameter.Optional } // Parameter defaults
);
I fixed by following these steps.