Results 1 to 8 of 8

Thread: [RESOLVED] Web custom control - hyperlink

  1. #1

    Thread Starter
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494

    Resolved [RESOLVED] Web custom control - hyperlink

    I've created a web custom control that works like the Windows explorer picture view folder (ie if there are pictures in the folder, it shows four little thumbnails of the pictures in the folder).

    The control is created by adding image controls to a table and renders fine.

    The only problem is that I want the user to be able to click anywhere in the table and navigate off to a page that displays the control.

    Using a hyperlink control isn't any good because the images i'm using aren't thumbnail size -- i create an image control and then set the height and width to make them tiny. If I try replacing the image with a hyperlink control, the pictures render at full size.

    Anyone got any ideas how I can do this?
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Web custom control - hyperlink

    Do you mean that you want to enable some sort of a table-cell click functionality?

  3. #3

    Thread Starter
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494

    Re: Web custom control - hyperlink

    Something like that would do.

    I just really want the entire control to act as a hyperlink rather than the individual images, but I'm not sure of the best way to go about it.

    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Web custom control - hyperlink

    You'd have to render a bit of css and javascript for that.

    First, set the style for the <TD> so that cursor = hand. Second, set an onClick action event for the <TD>

    This is NOT an ASP.NET example but gives you an idea of what you want:

    Code:
    <table width="100%">
    <tr>
    <td width="100%" style="cursor:hand;" 
    
    onClick="alert('dfkj');">abc&nbsp;&nbsp;</td>
    </tr></table>

  5. #5

    Thread Starter
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494

    Re: Web custom control - hyperlink

    Cheers Mendhak.

    Will lug my Javascript book back home with me tonight and give it a go

    The things I have to do to keep my new hubby happy

    He only married me so I'd redevelop his website for him
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Web custom control - hyperlink

    Erm... I'm not sure why you need to take your book with you just for this. It's simple javascript, as you can see.

    And don't worry about being used... my 'friends' often use me for their perverse coding pleasures.

  7. #7

    Thread Starter
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494

    Re: Web custom control - hyperlink

    Lol.....I know NOTHING about Javascript and my book is like a security blanket....makes me feel warm and safe and loved at night

    Just did a quick test with your code and all I needed to do was change the alert to navigate and the world was a very happy place.

    Thank you so much
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] Web custom control - hyperlink

    Welcome.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width