Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What's the difference between ASP.NET1.1 and ASP.NET2.0 static file handling?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what is the difference between ASP.NET1.1 and ASP.NET2.0 static file processing". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

If htm (or other unmapped file types) is mapped to asp.net 's Aspnet _ isapi.dll in IIS, different HttpHandler is used to handle these requests in asp.net1.1 and 2.0, that is, static file processing.

StaticFileHandler is used for static file processing in asp.net 1.1.For more information, please see machine.config in 1.1:

< add verb="GET,HEAD" path="*" type=" System.Web.StaticFileHandler"/>

DefaultHttpHanlder is used in asp.net 2.0 for static file processing, as shown below (C:\ WINDOWS\ Microsoft.NET\ Framework\ v2.0.50727\ CONFIG\ web.config):

< add path="*" verb="GET,HEAD,POST" type=" System.Web.DefaultHttpHandler" validate="true" />

After mapping htm to asp.net 's Aspnet _ isapi.dll in IIS, if you access this htm file through a request from POST, you will receive the following error:

The HTTP verb POST used to access path'/ staticfile.htm' is not allowed.

The reason is that the DefaultHttpHandler in 2.0 rejects the POST request when processing the request.

The solution is to add the following code to the application's Web.config file:

< add path="*.htm" verb="GET,POST" type=" System.Web.StaticFileHandler" />

That's all for the content of "what's the difference between ASP.NET1.1 and ASP.NET2.0 static file processing". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report