ASP.NET 网页如何实现无扩展 URL?
我想为我自己的构建提供者实现同样的事情。
I'm talking about an ASP.NET Webpages application, in Visual Studio: File > New Website > ASP.NET Website (Razor)
Works with Cassini, so it's not an IIS Express thing.
I'd like to implement the same thing for my own build providers.
I'm talking about an ASP.NET Webpages application, in Visual Studio: File > New Website > ASP.NET Website (Razor)
Works with Cassini, so it's not an IIS Express thing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到了,它是一个HTTP模块,
System.Web.WebPages.WebPageHttpModule
该模块检查文件是否存在,如果存在,则从该文件创建一个处理程序,并将请求重新映射到该处理程序。
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 是一个模板引擎。它与 URL 无关。它们由 ASP.NET 路由引擎处理。从 IIS 7.0 开始支持无扩展名 URL。在 IIS 6.0 中,如果要支持无扩展名 url,则需要将 aspnet_isapi 扩展名与所有传入请求相关联。
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.
我发现了有关“路由”的信息,如果您正在构建不带 MVC3 的 ASP.Net 网页站点,并且想提及它,您可能会觉得它很方便。
创建更易读和可搜索的 URL - 关于路由
华泰
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