Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 2nd, 2008, 08:00 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Clickable background

I want to use following code for Clickable background.

<style type='text/css'>
  BODY { background-image:url('my.aspx?id=001') }
</style>

 where "my.aspx?id=001" will return an image randomly, but i also want this background
 to be clickable (Navigate to my randomly specified Url)
 How is it possible ? Share the Ideas and give me chance of thanks.

  #2 (permalink)  
Old April 2nd, 2008, 12:15 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You could add an onclick handler to the body element. This could do a client-side navigation instruction.

You should consider using a custom handler (ashx) instead of using a regular aspx page for the random image serving. It will be faster because it doesn't have the overhead of the page class.

-Peter
peterlanoie.blog
  #3 (permalink)  
Old April 4th, 2008, 12:30 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 Planoie,
   I have already done this task by JavaScript but my Client's requirement is to do via CSS.
   By custom handler (ashx) , How I will make my background clickable (Navigate to speciefied URL) without getting the innerHTML of Requested Page.
   Please guide me regard.
  #4 (permalink)  
Old April 8th, 2008, 08:51 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I haven't created custom handlers myself yet. A google search should yield plenty of help on it though.

I'm not sure what you mean by the second question. If you add a click handler to the body element, it's not going to "get" any HTML, it will just fire whatever javascript is in it. This script will just navigate to the specified page.

-Peter
peterlanoie.blog
  #5 (permalink)  
Old April 9th, 2008, 12:22 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Planoie,
        Thanks for ur time again. This task has been hold for some time as I restart the task and found any solution then I ll update you.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Clickable images Using xml and xsl(Urgent) Akriti XSLT 11 June 4th, 2007 05:45 AM
background images Maxxim CSS Cascading Style Sheets 14 February 14th, 2007 02:56 PM
Clickable images in grid or detailsview ewhizz ASP.NET 2.0 Basics 1 August 2nd, 2006 10:33 AM
Make a control Clickable Hal Levy ASP.NET 1.0 and 1.1 Basics 3 November 7th, 2003 01:24 PM
fetch in background? RCC_msolomon ADO.NET 6 June 25th, 2003 10:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.