zoukankan      html  css  js  c++  java
  • 【asp.net】Using ASP.NET MVC on IIS 5

    This is a small note for people trying to play with the MVC framework, and that are currently using Windows XP. If you dislike the ASP.NET development server that comes by default with Visual Studio as much as I do, you've switched your MVC application to work against IIS already. WinXP is running IIS 5, and you'll notice that the routing will stop working for you once you make that switch.

    For instance, a request for /Products/Categories, where Products is a controller and Categories is an action on the controller, will fail. The problem is that IIS never routes this request to ASP.NET. Since you are not asking for a .aspx page, there's no way for it to know that it needs to load ASP.NET at all. So you have to tell it to map all the requests to ASP.NET. You'll do it like this:

       1. Right-click your application virtual directory on inetmgr.exe.
       2. Properties->Virtual Directory Tab-> Configuration.
       3. Add a new mapping extension. The extension should be .*, which will be mapped to the Executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll, or the appropriate location on your computer (you can simply copy this from the mapping for .aspx files). On the mapping uncheck "check that file exists".
       4. 3 X OK and you're good to go.
       5. If you want, you can apply this setting to all your web sites. In step1, click on the "Default Web Site" node instead of your own virtual directory, and in step 2 go to the "Home Directory" tab. The rest is the same.

    Now you've mapped every request on the web site to ASP.NET. To check that it works you can request a non existing html file on your web-site and see that the error you get is with an ASP.NET footer.
    Published Saturday, December 15, 2007 1:13 AM by dorony
  • 相关阅读:
    spring-tool-suite-4-4.3.2.RELEASE-e4.12.0-win32.win32.x86_64 下载
    day39_Spring学习笔记_07_CRM_03
    MyEclipse 中 报错 ERROR PARSER:56
    day38_Spring学习笔记_06_CRM_02
    最简单的递归/死循环
    day37_Spring学习笔记_05_CRM_01
    如何在Linux中发现IP地址冲突
    如何在Linux中用命令行工具管理KVM虚拟环境
    使用 Shell 脚本自动化 Linux 系统维护任务
    Linux系统多网卡绑定实战
  • 原文地址:https://www.cnblogs.com/guanjie20/p/1739707.html
Copyright © 2011-2022 走看看