469,635 Members | 2,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,635 developers. It's quick & easy.

How to change Background Image

Hi

In my ASP.NET application I try to change dynamicly picture in background of
page.
Ther is any way to do it without using webcontrols(like panel)
I wrote the public function named getName() that return string "pic\1.jpg"
and put this into html tag
<body background="<%# getName()%>" bottomMargin=0 leftMargin=0 topMargin=0
rightMargin=0>
but it doesn't work.

please help

chris
Nov 18 '05 #1
3 1615
Hi Chris,

Why dont you use JavaScript and get/set the background propertry as
document.body.background.

Else, you can try wht is said here:
http://www.experts-exchange.com/Web/..._20833240.html . Scroll
down...

--
Cheers!
Rajiv. R
Rajspace.Org
"Bobofrut" <bo******@o2.pl> wrote in message
news:c1**********@nemesis.news.tpi.pl...
Hi

In my ASP.NET application I try to change dynamicly picture in background of page.
Ther is any way to do it without using webcontrols(like panel)
I wrote the public function named getName() that return string "pic\1.jpg" and put this into html tag
<body background="<%# getName()%>" bottomMargin=0 leftMargin=0 topMargin=0
rightMargin=0>
but it doesn't work.

please help

chris

Nov 18 '05 #2
Jos
Bobofrut wrote:
Hi

In my ASP.NET application I try to change dynamicly picture in
background of page.
Ther is any way to do it without using webcontrols(like panel)
I wrote the public function named getName() that return string
"pic\1.jpg" and put this into html tag
<body background="<%# getName()%>" bottomMargin=0 leftMargin=0
topMargin=0 rightMargin=0>
but it doesn't work.

please help

chris


<%= getName()%>

Use = , not #.

The hash sign is used for databinding syntax, which will be executed
only when the DataBind() method is called.

The <%= %> code is run when the page is rendered.

--

Jos
Nov 18 '05 #3
Thanks a lot ...
It was realy easy
"<%=getName()%>"

chris
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Spike | last post: by
3 posts views Thread by bigoxygen | last post: by
2 posts views Thread by chris_culley | last post: by
1 post views Thread by roN | last post: by
1 post views Thread by rockdale | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.