webform报错:The HTTP verb POST used to access path * is not allow的解决办法
2010-08-31 15:42
501 查看
解决类似:不允许用于访问路径“../page.js”的 HTTP 谓词 POST
如果在IIS中将htm(或其它未映射的文件类型)映射至ASP.NET的Aspnet _ isapi.dll,在ASP.NET1.1和2.0中使用了不同的HttpHandler来处理这些请求。
ASP.NET 1.1中使用了StaticFileHandler,具体可参照1.1中的machine.config:
<add verb="GET,HEAD" path="*" type=" System.Web.StaticFileHandler"/>
ASP.NET 2.0中使用了DefaultHttpHanlder,如下所示(C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/CONFIG/web.config):
<add path="*" verb="GET,HEAD,POST" type=" System.Web.DefaultHttpHandler" validate="true" />
在IIS中将htm映射至ASP.NET的Aspnet _ isapi.dll后,如果通过POST的请求访问此htm文件,则会收到以下错误:
The HTTP verb POST used to access path '/staticfile.htm' is not allowed.
原因在于2.0中的DefaultHttpHandler处理请求时会拒绝POST请求。
解决的方案就是在应用程序的Web.config文件中添加以下代码:
<add path="*.htm" verb="GET,POST" type=" System.Web.StaticFileHandler" />
如果在IIS中将htm(或其它未映射的文件类型)映射至ASP.NET的Aspnet _ isapi.dll,在ASP.NET1.1和2.0中使用了不同的HttpHandler来处理这些请求。
ASP.NET 1.1中使用了StaticFileHandler,具体可参照1.1中的machine.config:
<add verb="GET,HEAD" path="*" type=" System.Web.StaticFileHandler"/>
ASP.NET 2.0中使用了DefaultHttpHanlder,如下所示(C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/CONFIG/web.config):
<add path="*" verb="GET,HEAD,POST" type=" System.Web.DefaultHttpHandler" validate="true" />
在IIS中将htm映射至ASP.NET的Aspnet _ isapi.dll后,如果通过POST的请求访问此htm文件,则会收到以下错误:
The HTTP verb POST used to access path '/staticfile.htm' is not allowed.
原因在于2.0中的DefaultHttpHandler处理请求时会拒绝POST请求。
解决的方案就是在应用程序的Web.config文件中添加以下代码:
<add path="*.htm" verb="GET,POST" type=" System.Web.StaticFileHandler" />
相关文章推荐
- ASP.NET – The HTTP verb POST used to access path … is not allowed
- 发布网站,报Access to the path is denied的解决办法
- 发布网站,报Access to the path is denied的解决办法
- 发布网站,报Access to the path is denied的解决办法
- 安装 VMWare tools 时出现“The path "/usr/bin/gcc" is not valid path to the gcc binary”解决
- Failed to load http://localhost:8080/team.php: Request header field x-jwt-header is not allowed by Access-Control-Allow-Headers in preflight response.
- 解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to restriction
- Type interface is not known to the MapperRegistry.的解决办法
- ABP PUT、DELETE请求错误405.0 - Method Not Allowed 因为使用了无效方法(HTTP 谓词) 引发客户端错误 No 'Access-Control-Allow-Origin' header is present on the requested resource
- 关于“Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.”问题的解决
- Silverlight无法启动调试,错误“Unable to start debugging. The Silverlight Developer Runtime is not installed. Please install a matching version.” 解决办法
- Host is not allowed to connect to this MySQL server 和 access denied for user 'root'@'localhost' 解决办法
- JavaWeb:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决办法
- centos解决The path "" is not a valid path to the 3.2.0-4-amd64 kernel headers.问题
- 解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to restriction
- 解决安装vmware-tools出现的“The path "" is not a valid path to the 3.2.0-4-amd64 kernel headers”问题
- Type interface com.mapper.GradeMapper is not known to the MapperRegistry的解决办法
- Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier解决办法
- 解决办法:Access restriction: The type JPEGImageEncoder is not accessible due to restriction
- phpnow:open_basedir restriction in effect;file is not within the allowed path的解决办法