I'm getting below error always.
Bad Request - Invalid URL. HTTP Error 400. The request URL is invalid.
Everything after /Search/ is a query string which i have handled via routing.
routes.MapRoute(
"Search", // Route name
"Search/{*q}", // URL with parameters
new { controller = "Search", action = "Index", q = UrlParameter.Optional } // Parameter defaults
);
In above URL, I guess it's exceeding maximum query string parameter length so i tried increasing it like below.
<system.web>
<!--<httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/>-->
<httpRuntime targetFramework="4.5" maxUrlLength="2097151" relaxedUrlToFileSystemMapping="true" maxQueryStringLength="2097151" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxUrl="40960" maxQueryString="2097151" />
</requestFiltering>
</security>
</system.webServer>
I have tried request exceeds the configured maxQueryStringLength when using [Authorize]
How to configure the web.config to allow requests of any length