Reputation: 1
I am working on ASP.Net MVC 2.0 application with .Net framework 4.0 and IIS 6.1 (Windows 7). When I created virtual directory for my application, the URL routing working for all server side actions. But it doesn't consider static content path like images, scripts and style.
Please help me ASAP.....
UPDATE:
Hi David Thanks for your timely reply.........
Please note the following sample:
I have created a MVC application with the Controller named as Home
, inside the controller I am having a action named myhome
when I accessing the routed path like localhost/Home/myhome
, its accessed fine. Suppose I have some images on the view page. Those images not shown. Because of invalid path. But the same working with Windows 2008 R2's IIS7.0 and run directly from Visual Studio 2010. Only it didn't work on Virtual directly....!!
Upvotes: 0
Views: 619
Reputation: 15663
Are you hard coding paths with a leading slash? If so, stop and use Url.Content() instead. That will automagically handle your virtual directories.
Upvotes: 1
Reputation: 3942
Not much information to know your exact problem but something you can check is if "Anonymous authentication" is using your application pool identity.
On IIS7 double click on Authentication feature for your site and then "Edit..." (right click on "Anonymous Authentication) and change to "Application Pool identity" instead of IUSER.
Upvotes: 0