473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 6038
Hi Chris,

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

--
Regards,
Thomas Johansen (aka. Aylar)
Bobofrut <e-********@wp.pl> 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

Nov 18 '05 #2
Hi, chris,

Try

<%=getName()%>

instead.

Greetings
Martin
"Bobofrut" <e-********@wp.pl> wrote in message
news:c1**********@atlantis.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 #3
Jon
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" <e-********@wp.pl> wrote in message
news:c1**********@atlantis.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 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nathan Given | last post by:
Hello All, I am trying to randomly change the background image of my home page but I can't seem to figure it out. Here is a snippet of my css .... BODY {background:transparent...
1
by: nick | last post by:
I have the following code: <style> #item1 { DISPLAY: block; BACKGROUND: url(ProjMenuImgs/ProjBtn.gif) no-repeat 0px 0px; WIDTH: 87px; HEIGHT: 94px; } #item1:hover { background-position: 0...
3
by: Bobofrut | last post by:
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()...
1
by: Mike | last post by:
I want to change the background image of the html page within code based on the users selection. I'm trying to use this in the page onload even response.write("<body background=' & dataitem>") ...
2
by: urgido | last post by:
How I can change the background image to <li> tag when is clicked? Regards
4
by: Israel Richner | last post by:
I know I can use <a></aand modify it's :hover and :visited appearance in my .css file. I'd like to know if I can do the same for a asp:button control. I'd like to do some processing of data in...
1
by: can2564 | last post by:
Hello, I have an image as a background in the style sheet. The image is big and I would like to make it smaller. Can I do that in the style sheet? I really don't have room to crop. This is...
13
by: xbcn27 | last post by:
Hello , i'm trying to find a script that changes the background of the page by clicking different images... i mean, I have three different image backgrounds and i would like to have three small...
3
by: vartana | last post by:
I will be getting the background url dynamically using ajax and html. I have set an id=boxFooter_002 to my div and have ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.