How to change background image ??

Discussion in 'ASP .Net' started by Thomas Johansen, Feb 23, 2004.

  1. Hi Chris,

    Try adding runat="server" to your BODY tag, and it should work as expected.

    --
    Regards,
    Thomas Johansen (aka. Aylar)


    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
    Thomas Johansen, Feb 23, 2004
    #1
    1. Advertising

  2. Thomas Johansen

    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 23, 2004
    #2
    1. Advertising

  3. Hi, chris,

    Try

    <%=getName()%>

    instead.

    Greetings
    Martin
    "Bobofrut" <> wrote in message
    news:c1ck39$19r$...
    > 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
    >
    >
    Martin Dechev, Feb 23, 2004
    #3
  4. Thomas Johansen

    Jon Guest

    Hi,
    if you id the body tag then dim it up as a generic control you can change
    the background as needed, eg
    <body id="theBody" runat="server">
    Protected theBody As System.Web.UI.HtmlControls.HtmlGenericControl
    theBody.atttributes.add("background", getName())

    Jon

    "Bobofrut" <> wrote in message
    news:c1ck39$19r$...
    > 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
    >
    >
    Jon, Feb 23, 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. Bobofrut

    How to change Background Image

    Bobofrut, Feb 27, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    511
    Bobofrut
    Feb 27, 2004
  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,638
    Eliyahu Goldin
    Sep 28, 2004
  3. jc
    Replies:
    3
    Views:
    1,717
  4. jc
    Replies:
    1
    Views:
    1,358
    Neredbojias
    Mar 19, 2008
  5. Dj Frenzy
    Replies:
    3
    Views:
    298
    Robert
    Feb 10, 2004
Loading...

Share This Page