ASP. MVC has been released for some time and has only recently started learning.
Environment: Windows 7 (iis7.5), vs2008 + SP1, Asp.net MVC 1.0 official version
Problem: after being published to IIS, the image cannot be displayed.
label images cannot be displayed, and images in the style sheet can still be displayed.
Before release:
After release:
ProblemCodeAs follows:
<% = URL. Content ( " ~ /Content/AAA/1.jpg " ) %>
//MVC 1.0 generates HTML code "/content/AAA/1.jpg"
//HTML code generated by MVC2 preview 2 "/Demo/Content/AAA/1.jpg" added the virtual directory name
//Publish to IIS virtual directory name: Demo
Before release: http: // localhost: 3229/content/AAA/1.jpg can be accessed
Http: // localhost: 3229/Demo/Content/AAA/1.jpg cannot be in the range
After the release: http: // localhost/content/AAA/1.jpg cannot be accessed
Http: // localhost/Demo/Content/AAA/1.jpg can be accessed
This article is not the essence, because the problem is urgent,Send it to the homepage (remove the homepage after resolution)