image instead of text with HyperLinkField control

Discussion in 'ASP .Net' started by J055, Apr 6, 2006.

  1. J055

    J055 Guest

    Hi

    There doesn't appear to be a ImageUrl property for the HyperLinkField item.
    You can set an image in the header but not the field row. Or am I missing
    something?

    Is there an easy way round this or do I need to create my own solution with
    a TemplateItemField or create a custom control?

    Thanks
    Andrew
     
    J055, Apr 6, 2006
    #1
    1. Advertising

  2. Hi Andrew,

    As for the hyperlink with image, there is no built-in ASP.NET server
    controls associated. Also generally in normal html, we will use html <a>
    element with a nested <img> element to display image link. So in asp.net
    page, you can consider use the HtmlLink contorl <a runat="server"> with a
    nested <img> and we can manipulate it in server-side code.

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Apr 7, 2006
    #2
    1. Advertising

  3. J055

    J055 Guest

    Thanks again Steven.

    I'm still finding my way round the various controls as you can probably
    tell!

    I realise now that there are many differerent ways to acheive the same
    thing. I guess the hardest part is knowing which ones to use in which
    situations.

    Cheers
    Andrew
     
    J055, Apr 7, 2006
    #3
  4. Thanks for your response Andrew,

    Yes, for different page scenario, we may choose to use different html
    element combination to construct certain UI layout, and sometimes it also
    depend on the developer's personal habit :). Anyway, if you meed any
    further problem on this, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Apr 10, 2006
    #4
  5. The HyperLinkField class itself does not have a member that directly
    supports using images. The HyperLink controls that are rendered in the
    column, though, include an ImageUrl property that can be set
    programmatically during the RowDataBound event of the GridView control
    to render image links.

    On this page is an example of doing that

    http://authors.aspalliance.com/aspxtreme/webforms/controls/addinghyperli
    nkfieldstogridview.aspx
    ____________________

    Reynald V. Nuñez
    http://authors.aspalliance.com/aspxtreme

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Reynald Nuñez, Jul 3, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruno Alexandre

    HyperLinkField Help

    Bruno Alexandre, Dec 1, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,451
    Michael Tkachev
    Dec 6, 2004
  2. John Smith

    Adding a HyperLinkField to a DatGrid

    John Smith, Jun 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    946
    John Smith
    Jun 17, 2005
  3. =?Utf-8?B?TWljaGFlbFk=?=

    HyperLinkField

    =?Utf-8?B?TWljaGFlbFk=?=, Nov 17, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    4,117
    =?Utf-8?B?SkdvcmRvbg==?=
    Nov 17, 2005
  4. Evian Spring
    Replies:
    2
    Views:
    4,976
    Evian Spring
    Feb 16, 2006
  5. Support

    GridView - HyperLinkField: bind to a mailto instead

    Support, Dec 14, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    176
    Support
    Dec 14, 2005
Loading...

Share This Page