开发者

HttpHandler for Asp.NET MVC application

开发者 https://www.devze.com 2023-01-14 23:16 出处:网络
For general ASP.NET WebForms applications, the web page derives from Page class which implements IHttpHandler that servers actual web request.

For general ASP.NET WebForms applications, the web page derives from Page class which implements IHttpHandler that servers actual web request.

In ASP.NET MVC the webpage base class is System.Web.Mvc.ViewPage that also derives from Page class which in turn implements IHttpHandler.

But in the ASP.NET MVC Razor, the "cshtml" file derives from System.Web.Mvc.WebViewPage which actually does not implement IHttpHandler.

According to IIS ar开发者_开发技巧chitecture, in order to process a request, a class must implement IHttpHandler but this not the case with Razor view engine. How could it be possible?


Look at link text this cheat sheet.

ASP.NET MVC not use WebForms IHttpHandler. It is using MvcHandler from MvcRouteHandler.

ViewPage class invoke in ViewEngine. MVC model2 architecture style is not Page Controller style.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号