[Solved] ASP.Net Error: The request filtering module is configured to deny a request where the query string is too long

makumbi
 
on Jul 26, 2022 04:42 AM
1345 Views

I am getting this error below

The request filtering module is configured to deny a request where the query string is too long.
Most likely causes:

    Request filtering is configured on the Web server to deny the request because the query string is too long.

Things you can try:

    Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString setting in the applicationhost.config or web.config file.

Detailed Error Information:
Module	   RequestFilteringModule
Notification	   BeginRequest
Handler	   ExtensionlessUrl-Integrated-4.0
Error Code	   0x00000000
Requested URL	   http://localhost:2300/Account/Login?ReturnUrl=%2FAccount.aspx
Physical Path	   D:\SMIS2022WEB\SMIS2022WEB\SMIS2022WEB\Account\Login
Logon Method	   Not yet determined
Logon User	   Not yet determined
Request Tracing Directory	   C:\Users\Makumbi\OneDrive\Documents\IISExpress\TraceLogFiles\SMIS2022WEB
More Information:
This is a security feature. Do not change this feature unless the scope of the change is fully understood. You can configure the IIS server to reject requests whose query string is greater than a specified value. If the request's query string is greater than the configured value, this error is returned. If the allowed length of the query string needs to be increased, modify the configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString setting.

View more information »

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Jul 26, 2022 04:46 AM

Hi makumbi,

You need to set the maxQueryString and maxQueryStringLength in the Web.Config file.

maxQueryString

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxQueryString="32768"/>
    </requestFiltering>
  </security>
</system.webServer>

maxQueryStringLength

<system.web>
    <httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/>
</system.web>