Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i get this error when i pass a value in query string .i tried below code but the same error exists.How to fix this error
HTTP Error 404.15 - Not Found
The Request filtering module is configured to deny a request where the query string is too long

i use below code for url encryption if i remove this code no error is showing but i use this encryption code same error is coming.
<httpModules>
<add type="QueryStringModule" name="QueryStringModule"/>
</httpModules>


What I have tried:

<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxQueryString="3000" maxUrl="1000" /> /* Change the Url limit here */
</requestFiltering>
</security>
</system.webServer>
</configuration> 


<httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/>


<httpRuntime maxQueryStringLength="260" maxRequestLength="2048"/>
Posted
Updated 14-Feb-17 19:18pm
Comments
Karthik_Mahalingam 15-Feb-17 0:44am    
what is the query string length you have posted?
Raja Ganapathy 15-Feb-17 0:53am    
i pass the encrypted value
Karthik_Mahalingam 15-Feb-17 0:55am    
ok fine.. what is the length?
copy the string and paste in the chrome console window and check the length.
'yourstring'.length;
Raja Ganapathy 15-Feb-17 1:05am    
2859
Karthik_Mahalingam 15-Feb-17 1:10am    
in IIS or visual studio?

1 solution

try this,tested. it works as per your question and comments posted.
configure the web.config to allow requests of any length [^]
 
Share this answer
 
v2
Comments
Raja Ganapathy 15-Feb-17 1:36am    
i use this one earlier but this not working same error is coming
Karthik_Mahalingam 15-Feb-17 1:42am    
this is what i have changed,
<configuration>
  <system.webServer> 
      <security>
        <requestFiltering>
          <requestLimits maxQueryString="3500"/>
        </requestFiltering>
      </security>
   
  </system.webServer>
  
  <system.web>
     
    <httpRuntime maxQueryStringLength="3500" maxUrlLength="3500"/> 

    
  </system.web>
</configuration>
Raja Ganapathy 15-Feb-17 1:54am    
Thank you so much sir small mistake i have did :)
Karthik_Mahalingam 15-Feb-17 1:56am    
welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900