Missing alias when navigating to other web pages with IIS virtual directory
I have created an application under IIS7 Default Web Sites which with alias "DemoApp" (This web application is an MVC project with local IIS). First I created a virtual directory and then converted it into an application. In the authentication Basic Settings, it was set to connect as a specific user. When I run the application with URL http://localhost/DemoApp it loads the index page correctly. But when I select a menu item ("details" page) on the index page it loads an error page saying that the page cannot be found. The reason is the URL of the new page does not contain the alias (http://localhost/details). But if I change it to http://localhost/DemoApp/details, then it'll load the page correctly. Can someone tell me what I did wrong when I was creating the virtual directory in IIS?
I realized that it was because of missing tilde(~) in menu path which makes them relative. I changed the URL from "/details" to "~/details" and it's working fine.
链接地址: http://www.djcxy.com/p/61198.html上一篇: fpassthru()替代