开发者

How does ASP.NET WebPages implement extensionless URLs?

I'd like to implement the same thing for my own build providers.


I'm talking about an ASP.NET Webpages application, in Visual 开发者_Go百科Studio: File > New Website > ASP.NET Website (Razor)
Works with Cassini, so it's not an IIS Express thing.


I found it, it's an HTTP module, System.Web.WebPages.WebPageHttpModule This module checks if the file exists, and if it does it creates a handler from that file and remaps the request to that handler.


Razor is a templating engine. It has nothing to do with URLs. They are handled by the ASP.NET routing engine. Extensionless URLs are supported starting from IIS 7.0. In IIS 6.0 you need to associate the aspnet_isapi extension with all incoming requests if you want to support extensionless urls.


I found this information in regard to the "Routing" that you might find handy if you are building an ASP.Net WebPages site w/o MVC3 and wanted to mention it.

Creating More Readable and Searchable URLs - About Routing

HTH

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜