Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Background image in master page will not display

Posted on 2006-05-06
12
Medium Priority
?
405 Views
Last Modified: 2012-08-13
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?
0
Comment
Question by:rmmarsh
  • 6
  • 5
12 Comments
 
LVL 6

Expert Comment

by:the_paab
ID: 16622446
Do you have the backgorund image set in this way in your masterpage?

<body background="image.jpg">

0
 

Author Comment

by:rmmarsh
ID: 16622469
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
 
LVL 11

Expert Comment

by:TornadoV
ID: 16622775
Try to move prager_header.gif into a different folder, 'img' for example, then everything should work fine.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:rmmarsh
ID: 16622813
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
 
LVL 11

Expert Comment

by:TornadoV
ID: 16622827
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
 

Author Comment

by:rmmarsh
ID: 16622854
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
 
LVL 11

Expert Comment

by:TornadoV
ID: 16622922
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
 

Author Comment

by:rmmarsh
ID: 16623036
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
 
LVL 11

Expert Comment

by:TornadoV
ID: 16623067
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
 
LVL 11

Accepted Solution

by:
TornadoV earned 2000 total points
ID: 16623072
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
 

Author Comment

by:rmmarsh
ID: 16623449
sorry... none of those ideas work...  any others?
0
 

Author Comment

by:rmmarsh
ID: 16623460
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month20 days, 22 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question