ankur
ankur

Reputation: 4733

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

i have hosted my application on IIS 6.0 the view that i wanted to browse is getting 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.

Upvotes: 2

Views: 860

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038880

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?

Upvotes: 2

Related Questions