How to change Background Image

Discussion in 'ASP .Net' started by Bobofrut, Feb 27, 2004.

  1. Bobofrut

    Bobofrut Guest

    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, Feb 27, 2004
    #1
    1. Advertising

  2. Bobofrut

    Rajiv R Guest

    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/Web_Languages/Q_20833240.html . Scroll
    down...

    --
    Cheers!
    Rajiv. R
    Rajspace.Org


    "Bobofrut" <> wrote in message
    news:c1n4ai$sup$...
    > 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
    >
    >
     
    Rajiv R, Feb 27, 2004
    #2
    1. Advertising

  3. Bobofrut

    Jos Guest

    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
     
    Jos, Feb 27, 2004
    #3
  4. Bobofrut

    Bobofrut Guest

    Thanks a lot ...
    It was realy easy
    "<%=getName()%>"

    chris
     
    Bobofrut, Feb 27, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Johansen

    How to change background image ??

    Thomas Johansen, Feb 23, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    9,356
  2. =?Utf-8?B?TWlrZQ==?=

    change background image in code

    =?Utf-8?B?TWlrZQ==?=, Sep 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,656
    Eliyahu Goldin
    Sep 28, 2004
  3. jc
    Replies:
    3
    Views:
    1,733
  4. jc
    Replies:
    1
    Views:
    1,371
    Neredbojias
    Mar 19, 2008
  5. Dj Frenzy
    Replies:
    3
    Views:
    312
    Robert
    Feb 10, 2004
Loading...

Share This Page