In particular, I am going to point out extensionless URL's and virtual directories in IIS 5.1. And yes, I said IIS 5.1. Unfortunately our servers are running 2003.
Something that had been bothing me for some time was the problem that when you had a site in a virtual directory, none of the links worked with a simple @HTML.ActionLink(...) call. In general, within a View, if you wanted a simple url link you could do "@Html.ActionLink("LinkName","ControllerName","ActionName") and it would automatically map the URL relatively. The above would turn into "/ControllerName/ActionName".
If the site was hosted in a virtual directory (call it "testSite"), then the above ActionLink would resolve to "/testSite/ControllerName/ActionName".
But after publishing to it, even after adding the Extensionless effect, it would always fail on me. And I always had to resort to other means.
Until today.
Note the Checkbox on the bottom left "Check if file exists". Admittedly I don't know why, but having that checked will create 404 Not Found errors on ActionLinks within virtual directories. Unchecked that and BAM! They are found now!
No comments:
Post a Comment