Can I put an image in a HyperLinkField?

Posted on 2006-05-22
Last Modified: 2008-01-16
I have a gridview like this:

                <asp:GridView ID="PatientList1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="PDAGetPatientList" AllowSorting="True" >

                <asp:BoundField DataField="fldLastName" HeaderText="Last Name" SortExpression="fldLastName" />

                <asp:BoundField DataField="fldFirstName" HeaderText="First Name" SortExpression="fldFirstName" />

                <asp:HyperLinkField DataNavigateUrlFields="fldID" DataNavigateUrlFormatString="Details.aspx?ID={0}"
                    DataTextField="fldID" HeaderText="ID" SortExpression="fldID" />
                    Text="Labs" />



I want my second hyperlink to be an image rather than text. How do I do this? A HyperLinkField doesn't appear to have an image property.

Question by:cjmackenzie
    LVL 5

    Accepted Solution

    In the text property try writing an img tag and check.. i think it should work

    HeaderText =<img src="yourimg.jpg" />


    Author Comment

    Thank-you. Seems obvious now. Thanks for the prompt answer.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now