views:

4774

answers:

6

I've added a jpg file to the App_localResources folder and in the document properites specified the photo in the Background propery. In the designer it shows up as the background but when i run the page i still get the white page background.

A: 

Guessing that perhaps you have a stylesheet which might be overriding the background?

ahockley
A: 

No, I don't have a stylesheet set up

Could you post the code that's inside the <head> tags as well as the <body> tag attributes?
ahockley
A: 

I would check if the built in web server was still running and stop it, then re-run your application.

* Right click on the tray icon and select "Stop".

The page is being cached, you should see your changes now.

JWD
+3  A: 

There's no distinctly ASP.Net way of doing this.

The canonical HTML way is to include this CSS:

body { background-image: url('background.jpg'); }

If you defined the body tag with runat="server" you could add the style inline using the Attributes property, but this wouldn't be a good idea. Layout details like this should go in the Stylesheet.

Adam Lassek
A: 

I used fiddler to trace the calls on the image. App_LocalResources\*.jpg return an 403 error. The App_LocalResources folder is really for use for localization. If I move the image into an image folder it works fine. Also rather than setting the Background property, use the Style property and the background property there.

MrJavaGuy
A: 

Me too facing the same problem. I dint know what to do...

Anand