tags:

views:

161

answers:

2

Hi,

I have dev an MVC app and deployed it to my local IIS as I am using dev server to dev.

This is on Vista Ultimate.

When i browse the site all the images are not showing and also the login page is displayed.

what would be causing the images not to show and also why the login page showed when I have not set up security in web.config?

I tried to see if the ASPNET account had permissions but there is user of that name and there is no Add option in properies either.

Malcolm

A: 

I had a problem with images displaying in an MVC app until I coded the image tags like this:

<img src="<%= Uri.Content("./content/images/image.png") %>" alt="text" />
rjrapson
+2  A: 

This could be a deployment issue, rather than a permissions issue. Did you try to browse directly to an image via your browser?

So if you have an image located in your project as

\images\login.png

open in your browser to:

http://hostname/images/login.png

If this works, then you have got a referencing problem in your html. From memory, most images in asp.net mvc are located with:

src="../../images/login.png"

This could break down if your pathing is different to the current location. I usually prefer this:

src="/images/login.png"

or even better:

src="<%= ResolveUrl("~/images/login.png")%>"
eyesnz