Background image in master page will not display

Can anyone tell me why my image in the master page will not display?  everything else displays, but not the image... are there restrictions as to what kind of image you have to use?
rmmarshAsked:
Who is Participating?
 
TornadoVConnect With a Mentor Commented:
You can also move your prager_header.gif right into the root folder of your project, then your background image source will look like this: url(prager_header.gif);
0
 
the_paabCommented:
Do you have the backgorund image set in this way in your masterpage?

<body background="image.jpg">

0
 
rmmarshAuthor Commented:
I'm using Visual Web Developer 2005 and this is what it generates:

    <form id="form1" runat="server">
    <div style="background-image: url(App_Data/prager_header.gif); color: black; font-family: Verdana; background-position: center top; background-repeat: no-repeat; text-align: center;" unselectable="on">
        <br />
  ...
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
TornadoVCommented:
Try to move prager_header.gif into a different folder, 'img' for example, then everything should work fine.
0
 
rmmarshAuthor Commented:
I take the standard image from the toolbox and move it to the form... then I try to set the image url and it only allows me to select something from App_Data...  is there something special about images?  I am reading that book that comes free when you register, and it's pretty much worthless...

0
 
TornadoVCommented:
There is nothing special about images, it's just you're trying to access an image inside of the application folder.  The content of application folders, except for the App_Themes folder, is not served in response to Web requests, but it can be accessed from application code.  Basically App_Data is one of those folders that is not accessible to the client.
0
 
rmmarshAuthor Commented:
So how do I add an image to my master page?  or to any page for that matter... images just don't display and they don't give me any to indicate where to find them other than App_Data...
0
 
TornadoVCommented:
All you have to do is either in your VS 2005 or right in the windows explorer directory where your site is located add a new folder called 'images', 'img', 'media' or any other name, then move your prager_header.gif in that folder and then instead of url(App_Data/prager_header.gif); put url("Your newly created folder name"/prager_header.gif);.  Everything should work.
0
 
rmmarshAuthor Commented:
You don't get a choice... it has to be in the App_Data directory... I have it in another directory now, and when I go to indicate SRC, I can only get what's in the App_Data file... weird... maybe I've got a bug?
0
 
TornadoVCommented:
You can simply modify div's style right in source view of your .aspx page.  Just type in <div style="background-image:url("Your newly created folder name"/prager_header.gif); instead of url(App_Data/prager_header.gif); and don't select it from a wizard.  
0
 
rmmarshAuthor Commented:
sorry... none of those ideas work...  any others?
0
 
rmmarshAuthor Commented:
Oops... I mis-spoke... the last idea worked from TornadoV... seems if the IDE is in source mode I get an error... go to Design mode, and no  error, and it works...

Thank you so much for your help...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.