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

  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. Advertisements

  3. Hi, chris,

    Try

    <%=getName()%>

    instead.

    Greetings
    Martin
     
    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
     
    Jon, Feb 23, 2004
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.