Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem setting css style using relative path

1 view
Skip to first unread message

PeterKellner

unread,
Jul 29, 2006, 12:31:28 PM7/29/06
to
I'm having trouble setting a background style in a master page. The
declaration in the master page looks like this:

<div id="header_image" runat="server" style="background: transparent
url(images/bg_header.jpg) repeat-x scroll 0% 0%;;cursor: pointer;">

</div>

I tried adding runat="server" as well as changing the url to
~/images/bg_head.jpg but that didn't work.

Any suggestion on how to make the bg_header.jpg work on a master that
can be referended from aspx pages in subdirectories?

Thanks
Peter Kellner
http://peterkellner.net

msnews.microsoft.com

unread,
Jul 29, 2006, 5:03:25 PM7/29/06
to
~ is resolved using ResolveClientUrl(). As there is nothing in the CSS that
uses this routine, it will fail.

A couple of solutions.

1. Create the master page for the upper level and then another for indention
(a level off root)

2. Create the image link from web root, which means, for virtual
directories, you use the name of the virtual directory in the link. This
works, although it is not too elegant.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
"PeterKellner" <pkelln...@73rdstreet.com> wrote in message
news:47umc29dj7ja3vfsm...@4ax.com...

PeterKellner

unread,
Jul 30, 2006, 6:01:39 PM7/30/06
to
On Sat, 29 Jul 2006 16:03:25 -0500, "msnews.microsoft.com"
<NoSpamM...@comcast.netNoSpamM> wrote:

>~ is resolved using ResolveClientUrl(). As there is nothing in the CSS that
>uses this routine, it will fail.
>
>A couple of solutions.
>
>1. Create the master page for the upper level and then another for indention
>(a level off root)
>
>2. Create the image link from web root, which means, for virtual
>directories, you use the name of the virtual directory in the link. This
>works, although it is not too elegant.

Hi,

I don't quite understand what you mean by #2. Are you suggesting
spelling out the domain name in the css file? If so, I think that
would mean I'd have to change that each time I moved from one domain
to another (like testing to non-testing).

If you could explain, that would be a great help.
Peter Kellner
http://peterkellner.net

0 new messages