CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How to change background image dynamically?

Print topic Send  topic

Author Message
Jignesh
Posted: 06/30/2003, 7:14 AM

I have a COdeCHarge project in ASP w/ HTML TEmplates. I would like to change the background image of a page dynamically based on Random Numbers. I know how the ASP code which would generate a random number, based on which I shall select an image to be displayed. However I am not sure where should I write the code to change the image dynamically.

On a page where in ASP Code and HTML template are together, it is a straightforward insertion of the code. However over here, since ASP code and HTML templates are in two separate files, I don't want to spoil the HTML template by including ASP code in the page.

What I am looking for is a sort of solution where I can define a place holder tag in HTML template, which can be manipulated in the ASP code. Any ideas?

Thanks for your suggestion in advance.

Jignesh
rrodgers
Posted: 06/30/2003, 7:56 AM

If I wanted to change the background randomly on each page fetch/refresh I would add a label to the form. Move the {LabelName} tag into the opening tag for the <Body> Like this 'background="{LabelName}"' Then in the Page_AfterInitialize event I would assign the imagename to the LabelName.value.

I haven't tried this but this is what comes to mind.



rob
RonB
Posted: 07/05/2003, 4:24 AM

Use the set tag action. In html set the background tag (<body background={my_background} ...>)
with the set tag action insert the asp you already have and assign the result to a variable (in php $my_background)
Now transmit the tag to the page. That's all

Ron

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.