How do I increase the maxUrlLength property in the config in asp.net MVC 3?

I am getting this error:

The length of the URL for this request exceeds the configured maxUrlLength value.

Looking around the closest thing I can find is in the web.config,

<requestFiltering>
   <requestLimits maxUrl="xxx">
</requestFiltering>

However this is not MaxUrlLength nor does it resolve the issue. Any ideas how to fix?


As per Ashok's answer that would equate to:

<httpRuntime maxUrlLength="1024" relaxedUrlToFileSystemMapping="true"/>

within <system.web> section of the web.config.


Take a look at this post by Hanselman. Although this post is about accepting typically invalid characters in the URL he also mentions how to configure the length of the path and the query string

While we're in here, note that in ASP.NET 4 you can also change allowed path and queryString lengths:

<httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" />

我在使用C#.net 4创建的休息服务中遇到了此问题。我在Web.Config文件的system.web部分中设置了maxUrlLength变量。

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime maxUrlLength="2000"/>
  </system.web>
....
链接地址: http://www.djcxy.com/p/42016.html

上一篇: IIS HTTP错误500.19

下一篇: 如何增加asp.net MVC 3配置中的maxUrlLength属性?