How to change Background Image

  • Thread starter Thread starter Bobofrut
  • Start date Start date
B

Bobofrut

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
 
Bobofrut said:
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.
 
Back
Top