开发者

resolve url/url.content not fetching the correct path for css and scripts after hosting in IIS6.0

开发者 https://www.devze.com 2023-02-01 12:53 出处:网络
i have hosted my application on IIS 6.0 the view that i wanted to browse is gett开发者_JAVA技巧ing fetched in the browser but the css and scripts are not being rendered .

i have hosted my application on IIS 6.0 the view that i wanted to browse is gett开发者_JAVA技巧ing fetched in the browser but the css and scripts are not being rendered .

<link href="<%= Url.Content("~/Content/Tree.css")%>" rel="stylesheet" type="text/css" />

in this way i have given the path.


The link tag is properly defined. You are using the Url.Content method with a relative path from the site root which will correctly take into account the virtual directory which could be added when hosting under IIS.

I would recommend you looking at FireBug to see why the path is not found and what response does the server send when the CSS is fetched. Is the file missing? Or is there some other status code returned?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号