Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Master Page background image only visible from pages in root directory

 
Thread Tools Search this Thread
Old 05-24-2006, 08:46 AM   #1
Default Master Page background image only visible from pages in root directory


I hope I can explain this well enough to understand. I have a master page
that is used by almost all of the pages in my site. On the master page is a
table. In one of the cells in this table, I have set the background to
display an image that is located in a directory called "images" which is
just off the root directory. Here's the problem:

Any page that is not located in the root directory (where the master page is
located) cannot see the background image. Pages that ARE located in the
root directory can. I have tried using "~/images/filename.jpg" for the
background source but this didn't work. In fact, the only that has worked
so far is to put the full URL ("http://www.mysite.com/images/filename.jpg")
for the background source. I'm still relatively new to ASP.NET 2.0 and I
don't know what (if any) problems using the full URL might cause.

Can anyone suggest a solution (or is using the full URL for this the correct
way to go).

Thanks!




news.sbcglobal.net
  Reply With Quote
Old 05-24-2006, 09:00 AM   #2
Bruno Alexandre
 
Posts: n/a
Default Re: Master Page background image only visible from pages in root directory
thing of MasterPages like the includes in classic asp...

if you have your master.page in your root folder all the children must be in
the root...

so, the best practce is like this:

root
|--- images
|--- includes
|--- |--- css
|--- |--- js
|--- aspx
web.config
site.map

aspx folder could be several, like
|--- admin
|--- user
|--- master <--- add all the master pages in your website here 4 example
|--- profile
...

it's a clean way to build your website, I always start by the folders, and
then I start workin' in Master.Page and then the content pages.

inside aspx folder (or others) you put all your content pages and the
master page, and for all images all you need to do is:

"../images/...jpg" <-- so get back one folder (you'll be in root) and go to
images folder

if you follow my example, you wwill not having any problem with image links
and you'll have a nice and clean enviroment for your website.

by the way... the best way to have background images is in CSS!


--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)


"news.sbcglobal.net" <> escreveu na
mensagem news:cbUcg.77631$ et...
>I hope I can explain this well enough to understand. I have a master page
>that is used by almost all of the pages in my site. On the master page is
>a table. In one of the cells in this table, I have set the background to
>display an image that is located in a directory called "images" which is
>just off the root directory. Here's the problem:
>
> Any page that is not located in the root directory (where the master page
> is located) cannot see the background image. Pages that ARE located in
> the root directory can. I have tried using "~/images/filename.jpg" for
> the background source but this didn't work. In fact, the only that has
> worked so far is to put the full URL
> ("http://www.mysite.com/images/filename.jpg") for the background source.
> I'm still relatively new to ASP.NET 2.0 and I don't know what (if any)
> problems using the full URL might cause.
>
> Can anyone suggest a solution (or is using the full URL for this the
> correct way to go).
>
> Thanks!
>





Bruno Alexandre
  Reply With Quote
Old 05-24-2006, 09:24 AM   #3
Mark Rae
 
Posts: n/a
Default Re: Master Page background image only visible from pages in root directory
"Bruno Alexandre" <> wrote in message
news:...

> it's a clean way to build your website, I always start by the folders, and
> then I start workin' in Master.Page and then the content pages.


Me too.




Mark Rae
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
master page does not change due to preinit event not firing franchise63 General Help Related Topics 0 02-13-2008 09:18 AM
master page & app_theme folder doesn't work dummies2 General Help Related Topics 0 09-04-2007 05:41 PM
Classic Original Broadcasts Trading List - Updated ( w/o/c ) porkys1982@sbcglobal.net DVD Video 0 12-05-2005 03:38 AM
Classic Original Broadcasts Trading List - Updated ( w/o/c ) porkys1982@sbcglobal.net DVD Video 0 11-19-2005 04:46 PM
Original Airings : The A-Team , M*A*S*H , Taxi , Barney Miller , WKRP porkys1982@sbcglobal.net DVD Video 0 08-15-2005 03:09 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46